Skip to content

Commit 122d36e

Browse files
committed
add a backTo on a profile avatar page
1 parent 6b934d1 commit 122d36e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ROUTES.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const ROUTES = {
150150
},
151151
PROFILE_AVATAR: {
152152
route: 'a/:accountID/avatar',
153-
getRoute: (accountID: number) => `a/${accountID}/avatar` as const,
153+
getRoute: (accountID: number, backTo?: string) => getUrlWithBackToParam(`a/${accountID}/avatar` as const, backTo),
154154
},
155155

156156
DESKTOP_SIGN_IN_REDIRECT: 'desktop-signin-redirect',

src/pages/ProfilePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function ProfilePage({route}: ProfilePageProps) {
182182
<View style={[styles.avatarSectionWrapper, styles.pb0]}>
183183
<PressableWithoutFocus
184184
style={[styles.noOutline, styles.mb4]}
185-
onPress={() => Navigation.navigate(ROUTES.PROFILE_AVATAR.getRoute(accountID))}
185+
onPress={() => Navigation.navigate(ROUTES.PROFILE_AVATAR.getRoute(accountID, Navigation.getActiveRoute()))}
186186
accessibilityLabel={translate('common.profile')}
187187
accessibilityRole={CONST.ROLE.BUTTON}
188188
disabled={!hasAvatar}

0 commit comments

Comments
 (0)