From 4852a4e9cd0963b37ac2099ec7f29a42827ff74e Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 19 Apr 2024 22:26:59 +0700 Subject: [PATCH] Fix workspace avatar in workspace switcher --- src/components/WorkspaceSwitcherButton.tsx | 7 ++++--- src/pages/WorkspaceSwitcherPage/index.tsx | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/WorkspaceSwitcherButton.tsx b/src/components/WorkspaceSwitcherButton.tsx index 0e2465b09995..118fcd0f10a9 100644 --- a/src/components/WorkspaceSwitcherButton.tsx +++ b/src/components/WorkspaceSwitcherButton.tsx @@ -26,7 +26,7 @@ function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) { const pressableRef = useRef(null); - const {source, name, type} = useMemo(() => { + const {source, name, type, id} = useMemo(() => { if (!policy) { return {source: Expensicons.ExpensifyAppIcon, name: CONST.WORKSPACE_SWITCHER.NAME, type: CONST.ICON_TYPE_AVATAR}; } @@ -34,8 +34,9 @@ function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) { const avatar = policy?.avatar ? policy.avatar : getDefaultWorkspaceAvatar(policy?.name); return { source: avatar, - name: policy?.id ?? '', + name: policy?.name ?? '', type: CONST.ICON_TYPE_WORKSPACE, + id: policy?.id ?? '', }; }, [policy]); @@ -55,7 +56,7 @@ function WorkspaceSwitcherButton({policy}: WorkspaceSwitcherButtonProps) { > {({hovered}) => (