Skip to content

Commit

Permalink
Merge pull request #31051 from dukenv0307/fix/30509-different-chat-re…
Browse files Browse the repository at this point in the history
…port-opens-when-clicking-on-the-back-button-in-status-modal

App should navigate back to current chat report after closing status modal
  • Loading branch information
Beamanator authored Nov 16, 2023
2 parents 5e01376 + 69368d3 commit 47c7819
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/settings/Profile/CustomStatus/StatusPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) {
User.clearDraftCustomStatus();
};

const navigateBackToSettingsPage = useCallback(() => Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true), []);
const navigateBackToSettingsPage = useCallback(() => {
const topMostReportID = Navigation.getTopmostReportId();
if (topMostReportID) {
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(topMostReportID));
} else {
Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true);
}
}, []);

const updateStatus = useCallback(() => {
User.updateCustomStatus({text: defaultText, emojiCode: defaultEmoji});

Expand Down

0 comments on commit 47c7819

Please sign in to comment.