From 43746db86e679fb257546468bc018b9b49ec7e1c Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 13 Sep 2024 22:52:03 +0530 Subject: [PATCH 01/15] chore: migrate withOnyx to useOnyx --- .../Navigation/AppNavigator/AuthScreens.tsx | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index f2461f400678..0c0d68c4e6dc 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -1,7 +1,7 @@ import React, {memo, useEffect, useMemo, useRef} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; -import Onyx, {withOnyx} from 'react-native-onyx'; +import Onyx, {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import ComposeProviders from '@components/ComposeProviders'; import OptionsListContextProvider from '@components/OptionListContextProvider'; @@ -61,17 +61,6 @@ import OnboardingModalNavigator from './Navigators/OnboardingModalNavigator'; import RightModalNavigator from './Navigators/RightModalNavigator'; import WelcomeVideoModalNavigator from './Navigators/WelcomeVideoModalNavigator'; -type AuthScreensProps = { - /** Session of currently logged in user */ - session: OnyxEntry; - - /** The report ID of the last opened public room as anonymous user */ - lastOpenedPublicRoomID: OnyxEntry; - - /** The last Onyx update ID was applied to the client */ - initialLastUpdateIDAppliedToClient: OnyxEntry; -}; - const loadReportAttachments = () => require('../../../pages/home/report/ReportAttachments').default; const loadValidateLoginPage = () => require('../../../pages/ValidateLoginPage').default; const loadLogOutPreviousUserPage = () => require('../../../pages/LogOutPreviousUserPage').default; @@ -211,7 +200,10 @@ const modalScreenListenersWithCancelSearch = { }, }; -function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDAppliedToClient}: AuthScreensProps) { +function AuthScreens() { + const [session] = useOnyx(ONYXKEYS.SESSION) + const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID) + const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT) const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); @@ -567,14 +559,4 @@ AuthScreens.displayName = 'AuthScreens'; const AuthScreensMemoized = memo(AuthScreens, () => true); -export default withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, - lastOpenedPublicRoomID: { - key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, - }, - initialLastUpdateIDAppliedToClient: { - key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, - }, -})(AuthScreensMemoized); +export default AuthScreensMemoized; From 4df69bb5e73576b1a4f1c6412795c859f6e7e0a6 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 13 Sep 2024 23:59:00 +0530 Subject: [PATCH 02/15] lint fix --- ios/Podfile.lock | 24 +++++++++---------- .../Navigation/AppNavigator/AuthScreens.tsx | 6 ++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index bff8e0799f40..45534889fffa 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -28,17 +28,17 @@ PODS: - AppAuth/Core - boost (1.84.0) - DoubleConversion (1.1.6) - - EXAV (14.0.7): + - EXAV (14.0.6): - ExpoModulesCore - ReactCommon/turbomodule/core - EXImageLoader (4.7.0): - ExpoModulesCore - React-Core - - Expo (51.0.31): + - Expo (51.0.17): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore - - ExpoImage (1.12.15): + - ExpoImage (1.12.12): - ExpoModulesCore - libavif/libdav1d - SDWebImage (~> 5.19.1) @@ -49,7 +49,7 @@ PODS: - EXImageLoader - ExpoModulesCore - SDWebImageWebPCoder - - ExpoModulesCore (1.12.23): + - ExpoModulesCore (1.12.18): - DoubleConversion - glog - hermes-engine @@ -2405,13 +2405,13 @@ PODS: - Yoga - RNLocalize (2.2.6): - React-Core - - rnmapbox-maps (10.1.30): + - rnmapbox-maps (10.1.26): - MapboxMaps (~> 10.18.2) - React - React-Core - - rnmapbox-maps/DynamicLibrary (= 10.1.30) + - rnmapbox-maps/DynamicLibrary (= 10.1.26) - Turf - - rnmapbox-maps/DynamicLibrary (10.1.30): + - rnmapbox-maps/DynamicLibrary (10.1.26): - DoubleConversion - hermes-engine - MapboxMaps (~> 10.18.2) @@ -3098,13 +3098,13 @@ SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa boost: 26992d1adf73c1c7676360643e687aee6dda994b DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - EXAV: afa491e598334bbbb92a92a2f4dd33d7149ad37f + EXAV: 62e66b067185d630fe4cb4aa6eb0e48f72e67e0f EXImageLoader: ab589d67d6c5f2c33572afea9917304418566334 - Expo: 4773e11951abd0f666f67023f0cb1d48c3e8a32b + Expo: 675a5642b5860771507237259da50b921c03a9f3 ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 - ExpoImage: f77df382153d716f332f974438a803c4527f60b0 + ExpoImage: 2ccccff1219ebc765e344f3338f2430af2df4824 ExpoImageManipulator: aea99205c66043a00a0af90e345395637b9902fa - ExpoModulesCore: 335282d855cc34fb5540e170204e729a51464bbb + ExpoModulesCore: 606b7ca7c74186324975750c8a6f97b643f54ec9 FBLazyVector: 38bb611218305c3bc61803e287b8a81c6f63b619 Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814 FirebaseABTesting: 10cbce8db9985ae2e3847ea44e9947dd18f94e10 @@ -3231,7 +3231,7 @@ SPEC CHECKSUMS: RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 RNLiveMarkdown: cfc927fc0b1182e364237c72692e079107c6f5f1 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 - rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 + rnmapbox-maps: 5ab6bfd249cd67262615153c648f8d809aab781c RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 RNReactNativeHapticFeedback: a15b431d2903bc2eb3474ff8d9a05d3e67a70199 RNReanimated: 76901886830e1032f16bbf820153f7dc3f02d51d diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 0c0d68c4e6dc..a76886a7e0ce 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -201,9 +201,9 @@ const modalScreenListenersWithCancelSearch = { }; function AuthScreens() { - const [session] = useOnyx(ONYXKEYS.SESSION) - const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID) - const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT) + const [session] = useOnyx(ONYXKEYS.SESSION); + const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); + const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); From 94b1edd0fa622f2d621c67a7d963fd1a42973253 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Sat, 14 Sep 2024 00:01:05 +0530 Subject: [PATCH 03/15] revert podfile changes --- ios/Podfile.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 81167b6b529b..e6a521ead8b5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -28,17 +28,17 @@ PODS: - AppAuth/Core - boost (1.84.0) - DoubleConversion (1.1.6) - - EXAV (14.0.6): + - EXAV (14.0.7): - ExpoModulesCore - ReactCommon/turbomodule/core - EXImageLoader (4.7.0): - ExpoModulesCore - React-Core - - Expo (51.0.17): + - Expo (51.0.31): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore - - ExpoImage (1.12.12): + - ExpoImage (1.12.15): - ExpoModulesCore - libavif/libdav1d - SDWebImage (~> 5.19.1) @@ -49,7 +49,7 @@ PODS: - EXImageLoader - ExpoModulesCore - SDWebImageWebPCoder - - ExpoModulesCore (1.12.18): + - ExpoModulesCore (1.12.23): - DoubleConversion - glog - hermes-engine @@ -2405,13 +2405,13 @@ PODS: - Yoga - RNLocalize (2.2.6): - React-Core - - rnmapbox-maps (10.1.26): + - rnmapbox-maps (10.1.30): - MapboxMaps (~> 10.18.2) - React - React-Core - - rnmapbox-maps/DynamicLibrary (= 10.1.26) + - rnmapbox-maps/DynamicLibrary (= 10.1.30) - Turf - - rnmapbox-maps/DynamicLibrary (10.1.26): + - rnmapbox-maps/DynamicLibrary (10.1.30): - DoubleConversion - hermes-engine - MapboxMaps (~> 10.18.2) @@ -3098,13 +3098,13 @@ SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa boost: 26992d1adf73c1c7676360643e687aee6dda994b DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - EXAV: 62e66b067185d630fe4cb4aa6eb0e48f72e67e0f + EXAV: afa491e598334bbbb92a92a2f4dd33d7149ad37f EXImageLoader: ab589d67d6c5f2c33572afea9917304418566334 - Expo: 675a5642b5860771507237259da50b921c03a9f3 + Expo: 4773e11951abd0f666f67023f0cb1d48c3e8a32b ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 - ExpoImage: 2ccccff1219ebc765e344f3338f2430af2df4824 + ExpoImage: f77df382153d716f332f974438a803c4527f60b0 ExpoImageManipulator: aea99205c66043a00a0af90e345395637b9902fa - ExpoModulesCore: 606b7ca7c74186324975750c8a6f97b643f54ec9 + ExpoModulesCore: 335282d855cc34fb5540e170204e729a51464bbb FBLazyVector: 38bb611218305c3bc61803e287b8a81c6f63b619 Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814 FirebaseABTesting: 10cbce8db9985ae2e3847ea44e9947dd18f94e10 @@ -3231,7 +3231,7 @@ SPEC CHECKSUMS: RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 RNLiveMarkdown: e44918843c2638692348f39eafc275698baf0444 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 - rnmapbox-maps: 5ab6bfd249cd67262615153c648f8d809aab781c + rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 RNReactNativeHapticFeedback: a15b431d2903bc2eb3474ff8d9a05d3e67a70199 RNReanimated: 76901886830e1032f16bbf820153f7dc3f02d51d @@ -3250,4 +3250,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e479ec84cb53e5fd463486d71dfee91708d3fd9a -COCOAPODS: 1.15.2 +COCOAPODS: 1.15.2 \ No newline at end of file From b727cc4fac3cda1c4d913dcffc96378fd45b3021 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Sat, 14 Sep 2024 00:01:33 +0530 Subject: [PATCH 04/15] revert podfile changes --- ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e6a521ead8b5..7176ecd8453e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3250,4 +3250,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e479ec84cb53e5fd463486d71dfee91708d3fd9a -COCOAPODS: 1.15.2 \ No newline at end of file +COCOAPODS: 1.15.2 From 250275bd8dc0a66a466c32d5ccb97b34ad5476f2 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Mon, 16 Sep 2024 08:35:36 +0530 Subject: [PATCH 05/15] fix showing indicator --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index a76886a7e0ce..6d37a5568b2c 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -47,6 +47,7 @@ import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; import type * as OnyxTypes from '@src/types/onyx'; import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; +import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; import type ReactComponentModule from '@src/types/utils/ReactComponentModule'; import CENTRAL_PANE_SCREENS from './CENTRAL_PANE_SCREENS'; import createCustomStackNavigator from './createCustomStackNavigator'; @@ -201,9 +202,10 @@ const modalScreenListenersWithCancelSearch = { }; function AuthScreens() { - const [session] = useOnyx(ONYXKEYS.SESSION); - const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); - const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); + const [session, sessionStatus] = useOnyx(ONYXKEYS.SESSION); + const [lastOpenedPublicRoomID, lastOpenedPublicRoomIDStatus] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); + const [initialLastUpdateIDAppliedToClient, initialLastUpdateIDAppliedToClientStatus] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); + const isSessionLoading = isLoadingOnyxValue(sessionStatus, lastOpenedPublicRoomIDStatus, initialLastUpdateIDAppliedToClientStatus); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); @@ -382,6 +384,9 @@ function AuthScreens() { // Prevent unnecessary scrolling cardStyle: styles.cardStyleNavigator, }; + if (isSessionLoading) { + return; + } return ( From e605f5107e2ce4c319d5437b4984e69ca4299d97 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 18 Sep 2024 08:05:54 +0530 Subject: [PATCH 06/15] refactoring --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 0567964ebc78..38265cdca5c8 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -47,8 +47,8 @@ import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; import type * as OnyxTypes from '@src/types/onyx'; import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; -import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; import type ReactComponentModule from '@src/types/utils/ReactComponentModule'; import CENTRAL_PANE_SCREENS from './CENTRAL_PANE_SCREENS'; import createCustomStackNavigator from './createCustomStackNavigator'; @@ -206,7 +206,6 @@ function AuthScreens() { const [session, sessionStatus] = useOnyx(ONYXKEYS.SESSION); const [lastOpenedPublicRoomID, lastOpenedPublicRoomIDStatus] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); const [initialLastUpdateIDAppliedToClient, initialLastUpdateIDAppliedToClientStatus] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); - const isSessionLoading = isLoadingOnyxValue(sessionStatus, lastOpenedPublicRoomIDStatus, initialLastUpdateIDAppliedToClientStatus); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); @@ -385,7 +384,7 @@ function AuthScreens() { // Prevent unnecessary scrolling cardStyle: styles.cardStyleNavigator, }; - if (isSessionLoading) { + if (isLoadingOnyxValue(sessionStatus, lastOpenedPublicRoomIDStatus, initialLastUpdateIDAppliedToClientStatus)) { return; } @@ -563,6 +562,4 @@ function AuthScreens() { AuthScreens.displayName = 'AuthScreens'; -const AuthScreensMemoized = memo(AuthScreens, () => true); - -export default AuthScreensMemoized; +export default memo(AuthScreens, () => true); From e00d4c65c9599bfea1375a52907cdbf8a7023576 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 13 Sep 2024 22:52:03 +0530 Subject: [PATCH 07/15] chore: migrate withOnyx to useOnyx --- .../Navigation/AppNavigator/AuthScreens.tsx | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index b68b9441c38c..54d07e12b3a4 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -1,7 +1,7 @@ import React, {memo, useEffect, useMemo, useRef} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; -import Onyx, {withOnyx} from 'react-native-onyx'; +import Onyx, {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import ComposeProviders from '@components/ComposeProviders'; import OptionsListContextProvider from '@components/OptionListContextProvider'; @@ -63,17 +63,6 @@ import OnboardingModalNavigator from './Navigators/OnboardingModalNavigator'; import RightModalNavigator from './Navigators/RightModalNavigator'; import WelcomeVideoModalNavigator from './Navigators/WelcomeVideoModalNavigator'; -type AuthScreensProps = { - /** Session of currently logged in user */ - session: OnyxEntry; - - /** The report ID of the last opened public room as anonymous user */ - lastOpenedPublicRoomID: OnyxEntry; - - /** The last Onyx update ID was applied to the client */ - initialLastUpdateIDAppliedToClient: OnyxEntry; -}; - const loadReportAttachments = () => require('../../../pages/home/report/ReportAttachments').default; const loadValidateLoginPage = () => require('../../../pages/ValidateLoginPage').default; const loadLogOutPreviousUserPage = () => require('../../../pages/LogOutPreviousUserPage').default; @@ -213,7 +202,10 @@ const modalScreenListenersWithCancelSearch = { }, }; -function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDAppliedToClient}: AuthScreensProps) { +function AuthScreens() { + const [session] = useOnyx(ONYXKEYS.SESSION) + const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID) + const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT) const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); @@ -570,14 +562,4 @@ AuthScreens.displayName = 'AuthScreens'; const AuthScreensMemoized = memo(AuthScreens, () => true); -export default withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, - lastOpenedPublicRoomID: { - key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, - }, - initialLastUpdateIDAppliedToClient: { - key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, - }, -})(AuthScreensMemoized); +export default AuthScreensMemoized; From ba4e4ca8640edd73fc4622ae36862ef40dfddd43 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Fri, 13 Sep 2024 23:59:00 +0530 Subject: [PATCH 08/15] lint fix --- ios/Podfile.lock | 24 +++++++++---------- .../Navigation/AppNavigator/AuthScreens.tsx | 6 ++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0f1a42791d1e..229b13ea3fc2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -28,17 +28,17 @@ PODS: - AppAuth/Core - boost (1.84.0) - DoubleConversion (1.1.6) - - EXAV (14.0.7): + - EXAV (14.0.6): - ExpoModulesCore - ReactCommon/turbomodule/core - EXImageLoader (4.7.0): - ExpoModulesCore - React-Core - - Expo (51.0.31): + - Expo (51.0.17): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore - - ExpoImage (1.12.15): + - ExpoImage (1.12.12): - ExpoModulesCore - libavif/libdav1d - SDWebImage (~> 5.19.1) @@ -49,7 +49,7 @@ PODS: - EXImageLoader - ExpoModulesCore - SDWebImageWebPCoder - - ExpoModulesCore (1.12.23): + - ExpoModulesCore (1.12.18): - DoubleConversion - glog - hermes-engine @@ -2405,13 +2405,13 @@ PODS: - Yoga - RNLocalize (2.2.6): - React-Core - - rnmapbox-maps (10.1.30): + - rnmapbox-maps (10.1.26): - MapboxMaps (~> 10.18.2) - React - React-Core - - rnmapbox-maps/DynamicLibrary (= 10.1.30) + - rnmapbox-maps/DynamicLibrary (= 10.1.26) - Turf - - rnmapbox-maps/DynamicLibrary (10.1.30): + - rnmapbox-maps/DynamicLibrary (10.1.26): - DoubleConversion - hermes-engine - MapboxMaps (~> 10.18.2) @@ -3098,13 +3098,13 @@ SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa boost: 26992d1adf73c1c7676360643e687aee6dda994b DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - EXAV: afa491e598334bbbb92a92a2f4dd33d7149ad37f + EXAV: 62e66b067185d630fe4cb4aa6eb0e48f72e67e0f EXImageLoader: ab589d67d6c5f2c33572afea9917304418566334 - Expo: 4773e11951abd0f666f67023f0cb1d48c3e8a32b + Expo: 675a5642b5860771507237259da50b921c03a9f3 ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 - ExpoImage: f77df382153d716f332f974438a803c4527f60b0 + ExpoImage: 2ccccff1219ebc765e344f3338f2430af2df4824 ExpoImageManipulator: aea99205c66043a00a0af90e345395637b9902fa - ExpoModulesCore: 335282d855cc34fb5540e170204e729a51464bbb + ExpoModulesCore: 606b7ca7c74186324975750c8a6f97b643f54ec9 FBLazyVector: 38bb611218305c3bc61803e287b8a81c6f63b619 Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814 FirebaseABTesting: 10cbce8db9985ae2e3847ea44e9947dd18f94e10 @@ -3231,7 +3231,7 @@ SPEC CHECKSUMS: RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 RNLiveMarkdown: e44918843c2638692348f39eafc275698baf0444 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 - rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 + rnmapbox-maps: 5ab6bfd249cd67262615153c648f8d809aab781c RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 RNReactNativeHapticFeedback: 31833c3ef341d716dbbd9d64e940f0c230db46f6 RNReanimated: 76901886830e1032f16bbf820153f7dc3f02d51d diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 54d07e12b3a4..33367cdf2f37 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -203,9 +203,9 @@ const modalScreenListenersWithCancelSearch = { }; function AuthScreens() { - const [session] = useOnyx(ONYXKEYS.SESSION) - const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID) - const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT) + const [session] = useOnyx(ONYXKEYS.SESSION); + const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); + const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); From 61afdeea9b31f86c5561aa178b768485e7f66157 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Sat, 14 Sep 2024 00:01:05 +0530 Subject: [PATCH 09/15] revert podfile changes --- ios/Podfile.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 229b13ea3fc2..447a54da46ea 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -28,17 +28,17 @@ PODS: - AppAuth/Core - boost (1.84.0) - DoubleConversion (1.1.6) - - EXAV (14.0.6): + - EXAV (14.0.7): - ExpoModulesCore - ReactCommon/turbomodule/core - EXImageLoader (4.7.0): - ExpoModulesCore - React-Core - - Expo (51.0.17): + - Expo (51.0.31): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore - - ExpoImage (1.12.12): + - ExpoImage (1.12.15): - ExpoModulesCore - libavif/libdav1d - SDWebImage (~> 5.19.1) @@ -49,7 +49,7 @@ PODS: - EXImageLoader - ExpoModulesCore - SDWebImageWebPCoder - - ExpoModulesCore (1.12.18): + - ExpoModulesCore (1.12.23): - DoubleConversion - glog - hermes-engine @@ -2405,13 +2405,13 @@ PODS: - Yoga - RNLocalize (2.2.6): - React-Core - - rnmapbox-maps (10.1.26): + - rnmapbox-maps (10.1.30): - MapboxMaps (~> 10.18.2) - React - React-Core - - rnmapbox-maps/DynamicLibrary (= 10.1.26) + - rnmapbox-maps/DynamicLibrary (= 10.1.30) - Turf - - rnmapbox-maps/DynamicLibrary (10.1.26): + - rnmapbox-maps/DynamicLibrary (10.1.30): - DoubleConversion - hermes-engine - MapboxMaps (~> 10.18.2) @@ -3098,13 +3098,13 @@ SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa boost: 26992d1adf73c1c7676360643e687aee6dda994b DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - EXAV: 62e66b067185d630fe4cb4aa6eb0e48f72e67e0f + EXAV: afa491e598334bbbb92a92a2f4dd33d7149ad37f EXImageLoader: ab589d67d6c5f2c33572afea9917304418566334 - Expo: 675a5642b5860771507237259da50b921c03a9f3 + Expo: 4773e11951abd0f666f67023f0cb1d48c3e8a32b ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 - ExpoImage: 2ccccff1219ebc765e344f3338f2430af2df4824 + ExpoImage: f77df382153d716f332f974438a803c4527f60b0 ExpoImageManipulator: aea99205c66043a00a0af90e345395637b9902fa - ExpoModulesCore: 606b7ca7c74186324975750c8a6f97b643f54ec9 + ExpoModulesCore: 335282d855cc34fb5540e170204e729a51464bbb FBLazyVector: 38bb611218305c3bc61803e287b8a81c6f63b619 Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814 FirebaseABTesting: 10cbce8db9985ae2e3847ea44e9947dd18f94e10 @@ -3231,7 +3231,7 @@ SPEC CHECKSUMS: RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 RNLiveMarkdown: e44918843c2638692348f39eafc275698baf0444 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 - rnmapbox-maps: 5ab6bfd249cd67262615153c648f8d809aab781c + rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 RNReactNativeHapticFeedback: 31833c3ef341d716dbbd9d64e940f0c230db46f6 RNReanimated: 76901886830e1032f16bbf820153f7dc3f02d51d @@ -3250,4 +3250,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e479ec84cb53e5fd463486d71dfee91708d3fd9a -COCOAPODS: 1.15.2 +COCOAPODS: 1.15.2 \ No newline at end of file From 003585e5216dfd2ce0c1b2e23504c22dd833c617 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Sat, 14 Sep 2024 00:01:33 +0530 Subject: [PATCH 10/15] revert podfile changes --- ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 447a54da46ea..0f1a42791d1e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3250,4 +3250,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e479ec84cb53e5fd463486d71dfee91708d3fd9a -COCOAPODS: 1.15.2 \ No newline at end of file +COCOAPODS: 1.15.2 From 34dd64dced356b6faede45fe49c158625f95c0bb Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 18 Sep 2024 21:36:48 +0530 Subject: [PATCH 11/15] modify --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 33367cdf2f37..58207d129546 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -49,6 +49,7 @@ import SCREENS from '@src/SCREENS'; import type * as OnyxTypes from '@src/types/onyx'; import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; import type ReactComponentModule from '@src/types/utils/ReactComponentModule'; import CENTRAL_PANE_SCREENS from './CENTRAL_PANE_SCREENS'; import createCustomStackNavigator from './createCustomStackNavigator'; @@ -203,9 +204,9 @@ const modalScreenListenersWithCancelSearch = { }; function AuthScreens() { - const [session] = useOnyx(ONYXKEYS.SESSION); - const [lastOpenedPublicRoomID] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); - const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); + const [session, sessionStatus] = useOnyx(ONYXKEYS.SESSION); + const [lastOpenedPublicRoomID, lastOpenedPublicRoomIDStatus] = useOnyx(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID); + const [initialLastUpdateIDAppliedToClient, initialLastUpdateIDAppliedToClientStatus] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {shouldUseNarrowLayout, onboardingIsMediumOrLargerScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); @@ -384,6 +385,9 @@ function AuthScreens() { // Prevent unnecessary scrolling cardStyle: styles.cardStyleNavigator, }; + if (isLoadingOnyxValue(sessionStatus, lastOpenedPublicRoomIDStatus, initialLastUpdateIDAppliedToClientStatus)) { + return; + } return ( From 4f3af391658e30c70c5077135309162ab0b5785c Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 18 Sep 2024 08:05:54 +0530 Subject: [PATCH 12/15] refactoring --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 58207d129546..defe1cee1aa3 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -564,6 +564,4 @@ function AuthScreens() { AuthScreens.displayName = 'AuthScreens'; -const AuthScreensMemoized = memo(AuthScreens, () => true); - -export default AuthScreensMemoized; +export default memo(AuthScreens, () => true); From b5a4e3aa81febcff2285442470a617f54843360f Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 25 Sep 2024 07:35:40 +0530 Subject: [PATCH 13/15] fix tests --- tests/ui/PaginationTest.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index 9d120433daa1..d27b95f36ed5 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -238,6 +238,9 @@ async function signInAndGetApp(): Promise { }, }); + await Onyx.set(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, 1) + await Onyx.set(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, "1") + // We manually setting the sidebar as loaded since the onLayout event does not fire in tests AppActions.setSidebarLoaded(); }); From de337acb7fe585c461c74186e7e64e3ef1ffc859 Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 25 Sep 2024 07:45:25 +0530 Subject: [PATCH 14/15] fix lint --- tests/ui/PaginationTest.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index d27b95f36ed5..290f0d28fb9b 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -238,8 +238,9 @@ async function signInAndGetApp(): Promise { }, }); - await Onyx.set(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, 1) - await Onyx.set(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, "1") + await Onyx.set(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, 1); + + await Onyx.set(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, '1'); // We manually setting the sidebar as loaded since the onLayout event does not fire in tests AppActions.setSidebarLoaded(); From 99edd392902500abf2fec6dd9e32f3e3c7daebbf Mon Sep 17 00:00:00 2001 From: BhuvaneshPatil Date: Wed, 25 Sep 2024 07:50:43 +0530 Subject: [PATCH 15/15] fix test --- tests/ui/UnreadIndicatorsTest.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index c9cdd81cf9ba..c133e000a51f 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -181,6 +181,10 @@ function signInAndGetAppWithUnreadChat(): Promise { [USER_B_ACCOUNT_ID]: TestHelper.buildPersonalDetails(USER_B_EMAIL, USER_B_ACCOUNT_ID, 'B'), }); + await Onyx.set(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, 1); + + await Onyx.set(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, '1'); + // We manually setting the sidebar as loaded since the onLayout event does not fire in tests AppActions.setSidebarLoaded(); return waitForBatchedUpdatesWithAct();