Repository navigation
App should navigate back to current chat report after closing status modal - #31051
Conversation
…licking-on-the-back-button-in-status-modal
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const topMostReportID = Navigation.getTopmostReportId(); | ||
|
|
||
| const navigateBackToSettingsPage = useCallback(() => { | ||
| if (topMostReportID) { | ||
| Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(topMostReportID)); | ||
| } else { | ||
| Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true); | ||
| } | ||
| }, [topMostReportID]); |
There was a problem hiding this comment.
Should we take topMostReportID inside the navigateBackToSettingsPage function?
There was a problem hiding this comment.
@shubham1206agra I think we want the navigateBackToSettingsPage function to capture the latest value of topMostReportID which can change frequently, therefore it is better to leave const topMostReportID = Navigation.getTopmostReportId(); outside of the function and add topMostReportID as a dependency of useCallback hook
There was a problem hiding this comment.
Maybe I haven't used useCallback much recently, but if we put Navigation.getTopmostReportId(); inside navigateBackToSettingsPage, won't getTopmostReportId always get the most up to date topMostReportID
since getTopmostReportId will be called right when the value is needed?
There was a problem hiding this comment.
@Beamanator On the second thought, you are right. I updated the code, please let me know if any concerns
…licking-on-the-back-button-in-status-modal
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2023-11-08.at.4.11.57.PM.movMacOS: DesktopScreen.Recording.2023-11-08.at.4.16.33.PM.mov |
Beamanator
left a comment
There was a problem hiding this comment.
I don't quite understand your explanation @dukenv0307 , please let me know what I'm missing :D 🙏
|
@Beamanator Updated. Please help review again. Thanks |
Beamanator
left a comment
There was a problem hiding this comment.
Looks great to me, thanks @dukenv0307 - though I think we need another full test before merging, can you take care of that or @shubham1206agra ?
|
@Beamanator Works fine. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.1-13 🚀
|
Details
The app should navigate back to the current chat report after closing the status modal
Fixed Issues
$ #30509
PROPOSAL: #30509 (comment)
Tests
Precondition: The user has set a status.
Offline tests
QA Steps
Precondition: The user has set a status.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
and-resize.mov
Android: mWeb Chrome
chrome-resize.mov
iOS: Native
ios-resize.mov
iOS: mWeb Safari
saf-resize.mov
MacOS: Chrome / Safari
web-resize.mov
MacOS: Desktop
desktop-resize.mov