File tree Expand file tree Collapse file tree
src/components/ScreenWrapper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,12 +183,12 @@ function ScreenWrapper({
183183 const [ tryNewDot , tryNewDotMetadata ] = useOnyx ( ONYXKEYS . NVP_TRY_NEW_DOT ) ;
184184 const isLoadingTryNewDot = isLoadingOnyxValue ( tryNewDotMetadata ) ;
185185 const shouldBlockSingleEntryOldAppExit = shouldHideOldAppRedirect ( tryNewDot , isLoadingTryNewDot , CONFIG . IS_HYBRID_APP ) ;
186- const [ activeRouteWithoutParams , setActiveRouteWithoutParams ] = useState ( ( ) => Navigation . getActiveRouteWithoutParams ( ) ) ;
187- const initialURLWithoutParams = initialURL ?. replaceAll ( / \? .* / g, '' ) ;
188- const doesInitialURLMatchActiveRoute = ! ! initialURLWithoutParams ?. endsWith ( activeRouteWithoutParams ) ;
186+ const [ initialActiveRouteWithoutParams , setInitialActiveRouteWithoutParams ] = useState ( '' ) ;
189187 useEffect ( ( ) => {
190- Navigation . isNavigationReady ( ) . then ( ( ) => setActiveRouteWithoutParams ( Navigation . getActiveRouteWithoutParams ( ) ) ) ;
188+ Navigation . isNavigationReady ( ) . then ( ( ) => setInitialActiveRouteWithoutParams ( Navigation . getActiveRouteWithoutParams ( ) ) ) ;
191189 } , [ ] ) ;
190+ const initialURLWithoutParams = initialURL ?. replaceAll ( / \? .* / g, '' ) ;
191+ const doesInitialURLMatchActiveRoute = ! ! initialURLWithoutParams ?. endsWith ( Navigation . getActiveRouteWithoutParams ( ) || initialActiveRouteWithoutParams ) ;
192192
193193 usePreventRemove ( isSingleNewDotEntry && doesInitialURLMatchActiveRoute && ! shouldBlockSingleEntryOldAppExit , ( ) => {
194194 if ( ! CONFIG . IS_HYBRID_APP ) {
You can’t perform that action at this time.
0 commit comments