-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix: three not found view v2 #41665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
neil-marcellini
merged 30 commits into
Expensify:main
from
software-mansion-labs:@kosmydel/not-found-view-v2
Jul 23, 2024
Merged
Fix: three not found view v2 #41665
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a29d34e
Revert "[Revert] #36409 "Fix: three not found view""
kosmydel a535acb
fix #40509
kosmydel adf1ca4
fix one more issue on android
kosmydel c034221
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel b513239
fix comment
kosmydel ce12e86
change type
kosmydel d175fb5
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 4a9a77c
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 16ca1c0
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 35f21ea
Merge branch 'Expensify:main' into @kosmydel/not-found-view-v2
kosmydel 92015a6
fix: empty ProfilePage
kosmydel 54f1cff
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel fcbe4ff
Merge branch 'Expensify:main' into @kosmydel/not-found-view-v2
kosmydel ffa8cf7
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 145513d
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 001a36b
fix: add concurrent mode support
kosmydel e76dd16
fix: double navigation
kosmydel 04c420b
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 6cca6df
fix: double navigation when selecting workspace in settings
kosmydel 9487f61
continue previous commit
kosmydel 9ec0333
refactor: WorkspaceMoreFeaturesPage and WorkspaceReportFieldsPage
kosmydel ad96e9e
fix
kosmydel 37fc8c7
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 6d269c3
modify AccessOrNotFoundWrapper
kosmydel 4c50c13
small fix
kosmydel e8c80a3
Merge branch 'Expensify:main' into @kosmydel/not-found-view-v2
kosmydel ebfd706
Merge branch 'main' into @kosmydel/not-found-view-v2
kosmydel 2a00bb9
remove flag
BrtqKr 1488a51
Merge remote-tracking branch 'origin/main' into @kosmydel/not-found-v…
BrtqKr e60668b
prettier
kosmydel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import {useFocusEffect, useNavigationState} from '@react-navigation/native'; | ||
| import type {StackScreenProps} from '@react-navigation/stack'; | ||
| import React, {useCallback, useEffect, useMemo, useState} from 'react'; | ||
| import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; | ||
| import {View} from 'react-native'; | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import {withOnyx} from 'react-native-onyx'; | ||
|
|
@@ -97,6 +97,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, reimbursementAcc | |
| const activeRoute = useNavigationState(getTopmostRouteName); | ||
| const {translate} = useLocalize(); | ||
| const {isOffline} = useNetwork(); | ||
| const wasRendered = useRef(false); | ||
|
|
||
| const prevPendingFields = usePrevious(policy?.pendingFields); | ||
| const policyFeatureStates = useMemo( | ||
|
|
@@ -347,6 +348,24 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, reimbursementAcc | |
| PolicyUtils.goBackFromInvalidPolicy(); | ||
| }, [policy, prevPolicy]); | ||
|
|
||
| // We are checking if the user can access the route. | ||
| // If user can't access the route, we are dismissing any modals that are open when the NotFound view is shown | ||
| const canAccessRoute = activeRoute && menuItems.some((item) => item.routeName === activeRoute); | ||
|
|
||
| useEffect(() => { | ||
| if (!shouldShowNotFoundPage && canAccessRoute) { | ||
| return; | ||
| } | ||
| if (wasRendered.current) { | ||
| return; | ||
| } | ||
| wasRendered.current = true; | ||
| // We are dismissing any modals that are open when the NotFound view is shown | ||
| Navigation.isNavigationReady().then(() => { | ||
| Navigation.closeRHPFlow(); | ||
| }); | ||
| }, [canAccessRoute, shouldShowNotFoundPage]); | ||
|
Comment on lines
+351
to
+367
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The workspace’s initial route ( |
||
|
|
||
| const policyAvatar = useMemo(() => { | ||
| if (!policy) { | ||
| return {source: Expensicons.ExpensifyAppIcon, name: CONST.WORKSPACE_SWITCHER.NAME, type: CONST.ICON_TYPE_AVATAR}; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.