From eb6e5f589e9bf0e7fedd97835f4c16684ebdbb1b Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 21 May 2026 15:54:33 +0200 Subject: [PATCH] fix: hide redundant account switcher in mail sidebar inside Pro shell --- components/layout/sidebar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/layout/sidebar.tsx b/components/layout/sidebar.tsx index 72f422ed..0fc3133d 100644 --- a/components/layout/sidebar.tsx +++ b/components/layout/sidebar.tsx @@ -52,6 +52,7 @@ import { useEmailStore } from "@/stores/email-store"; import { toast } from "@/stores/toast-store"; import { debug } from "@/lib/debug"; import { AccountSwitcher } from "./account-switcher"; +import { useIsEmbedded } from "@/hooks/use-is-embedded"; import { useTour } from "@/components/tour/tour-provider"; interface SidebarProps { @@ -696,7 +697,11 @@ export function Sidebar({ } catch { return new Set(); } }); const emailKeywords = useSettingsStore(s => s.emailKeywords); - const hideAccountSwitcher = useSettingsStore(s => s.hideAccountSwitcher); + const isEmbedded = useIsEmbedded(); + // The Pro shell owns the global chrome (rail + tab bar), so the sidebar's + // own AccountSwitcher would be a redundant second account UI in the same + // pane. + const hideAccountSwitcher = useSettingsStore(s => s.hideAccountSwitcher) || isEmbedded; const enableUnifiedMailbox = useSettingsStore(s => s.enableUnifiedMailbox); const colorfulSidebarIcons = useSettingsStore(s => s.colorfulSidebarIcons); const tagCounts = useEmailStore(s => s.tagCounts);