Skip to content

Commit

Permalink
fix: get assistance page always backs to workspace list page after re…
Browse files Browse the repository at this point in the history
…load
  • Loading branch information
tienifr committed Nov 27, 2023
1 parent d985a0e commit 57d06d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
VALIDATE_LOGIN: 'v/:accountID/:validateCode',
GET_ASSISTANCE: {
route: 'get-assistance/:taskID',
getRoute: (taskID: string) => `get-assistance/${taskID}`,
getRoute: (taskID: string, backTo: string) => getUrlWithBackToParam(`get-assistance/${taskID}`, backTo),
},
UNLINK_LOGIN: 'u/:accountID/:validateCode',
APPLE_SIGN_IN: 'sign-in-with-apple',
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderWithBackButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function HeaderWithBackButton({
<Tooltip text={translate('getAssistancePage.questionMarkButtonTooltip')}>
<PressableWithoutFeedback
disabled={shouldDisableGetAssistanceButton}
onPress={singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.GET_ASSISTANCE.getRoute(guidesCallTaskID))))}
onPress={singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.GET_ASSISTANCE.getRoute(guidesCallTaskID, Navigation.getActiveRoute()))))}
style={[styles.touchableButtonImage]}
role="button"
accessibilityLabel={translate('getAssistancePage.questionMarkButtonTooltip')}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/GetAssistancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const defaultProps = {

function GetAssistancePage(props) {
const styles = useThemeStyles();
const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.SETTINGS_CONTACT_METHODS);
const menuItems = [
{
title: props.translate('getAssistancePage.chatWithConcierge'),
Expand Down Expand Up @@ -82,7 +83,7 @@ function GetAssistancePage(props) {
<ScreenWrapper testID={GetAssistancePage.displayName}>
<HeaderWithBackButton
title={props.translate('getAssistancePage.title')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
onBackButtonPress={() => Navigation.goBack(navigateBackTo)}
/>
<ScrollView>
<Section
Expand Down

0 comments on commit 57d06d2

Please sign in to comment.