-
Notifications
You must be signed in to change notification settings - Fork 3k
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
App should navigate back to current chat report after closing status modal #31051
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we take topMostReportID inside the navigateBackToSettingsPage function?
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 |
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.
I don't quite understand your explanation @dukenv0307 , please let me know what I'm missing :D 🙏
@Beamanator Updated. Please help review again. Thanks |
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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