-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix infinite skeleton when deleting expense and returning to self DM #83156
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -828,6 +828,10 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr | |
| return; | ||
| } | ||
|
|
||
| if (reportIDFromRoute) { | ||
| Navigation.removeReportScreen(new Set([reportIDFromRoute])); | ||
| } | ||
|
Comment on lines
+831
to
+833
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.
This effect now runs when Useful? React with 👍 / 👎. |
||
|
|
||
| // Only redirect if focused | ||
| if (!isFocused) { | ||
| return; | ||
|
|
@@ -845,7 +849,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr | |
| Navigation.isNavigationReady().then(() => { | ||
| navigateToConciergeChat(conciergeReportID); | ||
| }); | ||
| }, [reportWasDeleted, isFocused, deletedReportParentID, conciergeReportID]); | ||
| }, [reportWasDeleted, isFocused, deletedReportParentID, conciergeReportID, reportIDFromRoute]); | ||
|
|
||
| useEffect(() => { | ||
| if (!isValidReportIDFromPath(reportIDFromRoute)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ CONSISTENCY-3 (docs)
The index clamping logic here duplicates the same computation already performed inside
removeReportRoutesFromState(line 861). The returnedupdatedState.indexis already set toMath.max(0, Math.min(state.index, nextRoutes.length - 1))whendidRemoveRouteAtRootis true, so re-clamping it here is redundant.Since
removeReportRoutesFromStatealready returns the correctly computed index inupdatedState, you can simplify this to useupdatedState.indexdirectly:Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.