Skip to content

Commit

Permalink
fix: added initialLastUpdateIDAppliedToClient for mount event
Browse files Browse the repository at this point in the history
  • Loading branch information
barttom committed Jan 9, 2024
1 parent 1a3a02d commit 022e32f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/libs/Navigation/AppNavigator/AuthScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ type AuthScreensProps = {

/** Opt-in experimental mode that prevents certain Onyx keys from persisting to disk */
isUsingMemoryOnlyKeys: OnyxEntry<boolean>;

/** The last Onyx update ID was applied to the client */
initialLastUpdateIDAppliedToClient: OnyxEntry<number>;
};

const loadReportAttachments = () => require('../../../pages/home/report/ReportAttachments').default as React.ComponentType;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -187,7 +190,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, isUsingMemoryOnlyKeys = f
if (shouldGetAllData) {
App.openApp();
} else {
App.reconnectApp(lastUpdateIDAppliedToClient);
App.reconnectApp(initialLastUpdateIDAppliedToClient);
}

PriorityMode.autoSwitchToFocusMode();
Expand Down Expand Up @@ -336,4 +339,7 @@ export default withOnyx<AuthScreensProps, AuthScreensProps>({
isUsingMemoryOnlyKeys: {
key: ONYXKEYS.IS_USING_MEMORY_ONLY_KEYS,
},
initialLastUpdateIDAppliedToClient: {
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
},
})(AuthScreensMemoized);

0 comments on commit 022e32f

Please sign in to comment.