Skip to content

Commit bd0f3f2

Browse files
authored
Merge pull request #60901 from bernhardoj/fix/60566-cant-sign-up-when-logged-in-as-anon-user
Fix can't sign up as new user when logged in as anonymous user
2 parents 3885a40 + 59453e4 commit bd0f3f2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hooks/useAccountValidation.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import ONYXKEYS from '@src/ONYXKEYS';
44
// TODO: Remove/Update this hook once we remove the user data and migrate to account data in https://github.com/Expensify/App/issues/59277
55
function useAccountValidation() {
66
// Some places are using the current value to compare, so we shouldn't cast to boolean
7-
const [isAccountValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => account?.validated});
8-
const [isUserValidated] = useOnyx(ONYXKEYS.USER, {selector: (user) => user?.validated});
7+
const [isAccountValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => account?.validated, canBeMissing: true});
8+
const [isUserValidated] = useOnyx(ONYXKEYS.USER, {selector: (user) => user?.validated, canBeMissing: true});
99

10-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
11-
return isAccountValidated || isUserValidated;
10+
return isAccountValidated ?? isUserValidated;
1211
}
1312

1413
export default useAccountValidation;

0 commit comments

Comments
 (0)