Skip to content
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

Poc/fixes after review #170

Merged
merged 5 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,11 @@ function AttachmentModal({
text: translate('common.replace'),
onSelected: () => {
closeModal(true);
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID, report?.reportID, Navigation.getActiveRouteWithoutParams()),
);
Navigation.isNavigationReady().then(() => {
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID, report?.reportID, Navigation.getActiveRouteWithoutParams()),
);
});
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) {
return;
}

Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS.route);
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route);
User.clearUnvalidatedNewContactMethodAction();
}, [pendingContactAction?.actionVerified]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function DelegateMagicCodeModal({login, role, onClose, isValidateCodeActionModal
}

// Dismiss modal on successful magic code verification
Navigation.navigate(ROUTES.SETTINGS_SECURITY);
Navigation.goBack(ROUTES.SETTINGS_SECURITY);
}, [login, currentDelegate, role, addDelegateErrors]);

const onBackButtonPress = () => {
Expand Down
16 changes: 14 additions & 2 deletions src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,18 @@ function WorkspacesListPage() {
}, {});
}, [reports]);

const navigateToWorkspace = useCallback(
(policyID: string) => {
// On the wide layout, we always want to open the Profile page when opening workpsace settings from the list
if (shouldUseNarrowLayout) {
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID));
return;
}
Navigation.navigate(ROUTES.WORKSPACE_PROFILE.getRoute(policyID));
},
[shouldUseNarrowLayout],
);

/**
* Add free policies (workspaces) to the list of menu items and returns the list of menu items
*/
Expand Down Expand Up @@ -380,7 +392,7 @@ function WorkspacesListPage() {
return {
title: policy.name,
icon: policy.avatarURL ? policy.avatarURL : getDefaultWorkspaceAvatar(policy.name),
action: () => Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policy.id)),
action: () => navigateToWorkspace(policy.id),
brickRoadIndicator: !isPolicyAdmin(policy)
? undefined
: reimbursementAccountBrickRoadIndicator ??
Expand All @@ -405,7 +417,7 @@ function WorkspacesListPage() {
};
})
.sort((a, b) => localeCompare(a.title, b.title));
}, [reimbursementAccount?.errors, policies, isOffline, theme.textLight, policyRooms, session?.email, allConnectionSyncProgresses]);
}, [reimbursementAccount?.errors, policies, isOffline, session?.email, allConnectionSyncProgresses, theme.textLight, policyRooms, navigateToWorkspace]);

const getHeaderButton = () => (
<Button
Expand Down
Loading