Skip to content

Commit

Permalink
fix: login
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Jun 5, 2024
1 parent 3bc14fe commit cc278f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libs/Network/NetworkStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type Credentials from '@src/types/onyx/Credentials';

let credentials: Credentials | undefined;
let credentials: Credentials | null;
let authToken: string | null = null;
let authTokenType: ValueOf<typeof CONST.AUTH_TOKEN_TYPES> | null;
let currentUserEmail: string | null = null;
Expand Down Expand Up @@ -35,7 +35,7 @@ let isReadyPromise = new Promise((resolve) => {
* If the values are undefined we haven't read them yet. If they are null or have a value then we have and the network is "ready".
*/
function checkRequiredData() {
if (authToken === undefined || credentials === undefined) {
if (authToken === null || credentials === null) {
return;
}

Expand All @@ -62,7 +62,7 @@ Onyx.connect({
Onyx.connect({
key: ONYXKEYS.CREDENTIALS,
callback: (val) => {
credentials = val;
credentials = val ?? null;
checkRequiredData();
},
});
Expand All @@ -85,7 +85,7 @@ Onyx.connect({
},
});

function getCredentials(): Credentials | undefined {
function getCredentials(): Credentials | null {
return credentials;
}

Expand Down

0 comments on commit cc278f4

Please sign in to comment.