diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 9fc3b5813855..5773d3babfe7 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -59,7 +59,7 @@ const ROUTES = { route: 'bank-account/:stepToOpen?', getRoute: (stepToOpen = '', policyID = '', backTo?: string) => getUrlWithBackToParam(`bank-account/${stepToOpen}?policyID=${policyID}`, backTo), }, - WORKSPACE_SWITCHER: 'workspaceSwitcher', + WORKSPACE_SWITCHER: 'workspace-switcher', SETTINGS: 'settings', SETTINGS_PROFILE: 'settings/profile', SETTINGS_SHARE_CODE: 'settings/shareCode', diff --git a/src/components/MultipleAvatars.tsx b/src/components/MultipleAvatars.tsx index 8edcf9931ce2..1d1eea0d20ba 100644 --- a/src/components/MultipleAvatars.tsx +++ b/src/components/MultipleAvatars.tsx @@ -153,7 +153,7 @@ function MultipleAvatars({ const getAdaptedStateFromPath: typeof getStateFromPath = (path, options) => { const url = getPathWithoutPolicyID(path); - const policyID = extractPolicyIDFromPath(path); + const isAnonymous = isAnonymousUser(); + // Anonymous users don't have access to workspaces + const policyID = isAnonymous ? undefined : extractPolicyIDFromPath(path); const state = getStateFromPath(url, options); if (state === undefined) { throw new Error('Unable to parse path'); } - const adaptedState = getAdaptedState(state as PartialState>, policyID); return adaptedState; }; diff --git a/src/pages/TeachersUnite/SaveTheWorldPage.js b/src/pages/TeachersUnite/SaveTheWorldPage.js index 107c0e39b6a0..03df52050ce5 100644 --- a/src/pages/TeachersUnite/SaveTheWorldPage.js +++ b/src/pages/TeachersUnite/SaveTheWorldPage.js @@ -21,7 +21,7 @@ function SaveTheWorldPage() { shouldShowBackButton title={translate('sidebarScreen.saveTheWorld')} backgroundColor={theme.PAGE_THEMES[SCREENS.SAVE_THE_WORLD.ROOT].backgroundColor} - onBackButtonPress={() => Navigation.goBack(ROUTES.HOME)} + onBackButtonPress={Navigation.goBack} illustration={LottieAnimations.SaveTheWorld} > diff --git a/src/pages/WorkspaceSwitcherPage.js b/src/pages/WorkspaceSwitcherPage.js index f2ff3e718930..8eb61fa3c9d6 100644 --- a/src/pages/WorkspaceSwitcherPage.js +++ b/src/pages/WorkspaceSwitcherPage.js @@ -177,7 +177,6 @@ function WorkspaceSwitcherPage({policies}) { source: Expensicons.ExpensifyAppIcon, name: CONST.WORKSPACE_SWITCHER.NAME, type: CONST.ICON_TYPE_AVATAR, - displayInDefaultIconColor: true, }, ], brickRoadIndicator: getIndicatorTypeForPolicy(undefined), diff --git a/src/pages/home/sidebar/SidebarLinksData.js b/src/pages/home/sidebar/SidebarLinksData.js index efbd9c8e2f5f..1ef44d5f6c48 100644 --- a/src/pages/home/sidebar/SidebarLinksData.js +++ b/src/pages/home/sidebar/SidebarLinksData.js @@ -62,6 +62,12 @@ const propTypes = { // eslint-disable-next-line react/forbid-prop-types policyMembers: PropTypes.object, + + /** Session info for the currently logged in user. */ + session: PropTypes.shape({ + /** Currently logged in user accountID */ + accountID: PropTypes.number, + }), }; const defaultProps = { @@ -72,6 +78,9 @@ const defaultProps = { betas: [], policies: {}, policyMembers: {}, + session: { + accountID: '', + }, }; function SidebarLinksData({ diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index 8993d1d73e1c..2dafe16b5388 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -30,9 +30,6 @@ type Icon = { /** Fill color of the icon */ fill?: string; - - /** Icon should be displayed in its own color */ - displayInDefaultIconColor?: boolean; }; export type {Icon, PendingAction, PendingFields, ErrorFields, Errors, AvatarType};