Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=229 --cache --cache-location=node_modules/.cache/eslint",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=228 --cache --cache-location=node_modules/.cache/eslint",
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
"lint-watch": "npx eslint-watch --watch --changed",
"shellcheck": "./scripts/shellCheck.sh",
Expand Down
13 changes: 3 additions & 10 deletions src/libs/Navigation/AppNavigator/AuthScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@
}
let timezone: Timezone | null;
let currentAccountID = -1;
let isLoadingApp = false;
let lastUpdateIDAppliedToClient: OnyxEntry<number>;

Onyx.connect({

Check warning on line 125 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val hasn't accountID
Expand All @@ -142,7 +141,7 @@
},
});

Onyx.connect({

Check warning on line 144 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (!value || !isEmptyObject(timezone)) {
Expand All @@ -163,21 +162,14 @@
},
});

Onyx.connect({
key: ONYXKEYS.IS_LOADING_APP,
callback: (value) => {
isLoadingApp = !!value;
},
});

Onyx.connect({

Check warning on line 165 in src/libs/Navigation/AppNavigator/AuthScreens.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
callback: (value) => {
lastUpdateIDAppliedToClient = value;
},
});

function handleNetworkReconnect() {
function handleNetworkReconnect(isLoadingApp: boolean) {
if (isLoadingApp) {
App.openApp();
} else {
Expand Down Expand Up @@ -229,6 +221,7 @@
const {shouldUseNarrowLayout} = useResponsiveLayout();
const rootNavigatorScreenOptions = useRootNavigatorScreenOptions();
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: true});
const {toggleSearch} = useSearchRouterContext();
const currentUrl = getCurrentUrl();
const delegatorEmail = getSearchParamFromUrl(currentUrl, 'delegatorEmail');
Expand Down Expand Up @@ -301,7 +294,7 @@
}

NetworkConnection.listenForReconnect();
NetworkConnection.onReconnect(handleNetworkReconnect);
NetworkConnection.onReconnect(() => handleNetworkReconnect(!!isLoadingApp));
PusherConnectionManager.init();
initializePusher();
// Sometimes when we transition from old dot to new dot, the client is not the leader
Expand Down
Loading