From 022e32f46342b5e5fc74818941760a931d4f7694 Mon Sep 17 00:00:00 2001 From: bartektomczyk Date: Tue, 9 Jan 2024 09:34:33 +0100 Subject: [PATCH] fix: added initialLastUpdateIDAppliedToClient for mount event --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index d62c1e2f04b7..03a3612d4566 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -49,6 +49,9 @@ type AuthScreensProps = { /** Opt-in experimental mode that prevents certain Onyx keys from persisting to disk */ isUsingMemoryOnlyKeys: OnyxEntry; + + /** The last Onyx update ID was applied to the client */ + initialLastUpdateIDAppliedToClient: OnyxEntry; }; const loadReportAttachments = () => require('../../../pages/home/report/ReportAttachments').default as React.ComponentType; @@ -142,7 +145,7 @@ const modalScreenListeners = { }, }; -function AuthScreens({session, lastOpenedPublicRoomID, isUsingMemoryOnlyKeys = false}: AuthScreensProps) { +function AuthScreens({session, lastOpenedPublicRoomID, isUsingMemoryOnlyKeys = false, initialLastUpdateIDAppliedToClient}: AuthScreensProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {isSmallScreenWidth} = useWindowDimensions(); @@ -187,7 +190,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, isUsingMemoryOnlyKeys = f if (shouldGetAllData) { App.openApp(); } else { - App.reconnectApp(lastUpdateIDAppliedToClient); + App.reconnectApp(initialLastUpdateIDAppliedToClient); } PriorityMode.autoSwitchToFocusMode(); @@ -336,4 +339,7 @@ export default withOnyx({ isUsingMemoryOnlyKeys: { key: ONYXKEYS.IS_USING_MEMORY_ONLY_KEYS, }, + initialLastUpdateIDAppliedToClient: { + key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, + }, })(AuthScreensMemoized);