Skip to content

Commit

Permalink
fix: Room - No animation when returning to room settings after saving…
Browse files Browse the repository at this point in the history
… new room description.

Signed-off-by: krishna2323 <[email protected]>
  • Loading branch information
Krishna2323 committed Dec 27, 2024
1 parent cdefab1 commit d3af8b5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/pages/GroupChatNameEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ function GroupChatNameEditPage({groupChatDraft, report}: GroupChatNameEditPagePr
if (values[INPUT_IDS.NEW_CHAT_NAME] !== currentChatName) {
Report.updateGroupChatName(reportID, values[INPUT_IDS.NEW_CHAT_NAME] ?? '');
}
Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(reportID));

Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(reportID)));

return;
}
if (values[INPUT_IDS.NEW_CHAT_NAME] !== currentChatName) {
Report.setGroupDraft({reportName: values[INPUT_IDS.NEW_CHAT_NAME]});
}
Navigation.goBack(ROUTES.NEW_CHAT_CONFIRM);
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack(ROUTES.NEW_CHAT_CONFIRM));
},
[isUpdatingExistingReport, reportID, currentChatName],
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivateNotes/PrivateNotesEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function PrivateNotesEditPage({route, report, accountID}: PrivateNotesEditPagePr
if (!Object.values<Note>({...report.privateNotes, [route.params.accountID]: {note: editedNote}}).some((item) => item.note)) {
ReportUtils.navigateToDetailsPage(report, backTo);
} else {
Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID, backTo));
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID, backTo)));
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/RoomDescriptionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) {
}, []);

const goBack = useCallback(() => {
Navigation.goBack(backTo ?? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID));
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack(backTo ?? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID)));
}, [report.reportID, backTo]);

const submitForm = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Report/RoomNamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function RoomNamePage({report, reports}: RoomNamePageProps) {
const reportID = report?.reportID ?? '-1';

Check failure on line 45 in src/pages/settings/Report/RoomNamePage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check


const goBack = useCallback(() => {
Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID, route.params.backTo));
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID, route.params.backTo)));
}, [reportID, route.params.backTo]);

const validate = useCallback(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceNamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function WorkspaceNamePage({policy}: Props) {

Policy.updateGeneralSettings(policy.id, values.name.trim(), policy.outputCurrency);
Keyboard.dismiss();
Navigation.goBack();
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack());
},
[policy],
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceProfileDescriptionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function WorkspaceProfileDescriptionPage({policy}: Props) {

Policy.updateWorkspaceDescription(policy.id, values.description.trim(), policy.description ?? '');
Keyboard.dismiss();
Navigation.goBack();
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack());
},
[policy],
);
Expand Down

0 comments on commit d3af8b5

Please sign in to comment.