diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx index ef12b827c..9fc49c0a4 100644 --- a/packages/app/src/components/titlebar.tsx +++ b/packages/app/src/components/titlebar.tsx @@ -454,78 +454,78 @@ export function Titlebar(props: { update?: TitlebarUpdate }) { {(tab, i) => { let ref!: HTMLDivElement - const divider = () => - i() !== 0 && ( -
- ) + const divider = () => + i() !== 0 && ( +
+ ) + + if (tab.type === "draft") { + return ( + <> + {divider()} + { + navigateTab(tab) + ref.scrollIntoView({ behavior: "instant" }) + }} + onClose={() => tabsStoreActions.removeTab(i())} + /> + + ) + } - if (tab.type === "draft") { return ( <> {divider()} - { navigateTab(tab) + ref.scrollIntoView({ behavior: "instant" }) }} onClose={() => tabsStoreActions.removeTab(i())} + active={currentTab() === tab} + activeServer={tab.server === server.key} + forceTruncate={tabsAreOverflowing()} /> ) - } + }} + + + {(_) => { + let ref!: HTMLDivElement - return ( - <> - {divider()} - { - navigateTab(tab) + onMount(() => { + ref.scrollIntoView({ behavior: "instant" }) + }) - ref.scrollIntoView({ behavior: "instant" }) - }} - onClose={() => tabsStoreActions.removeTab(i())} - active={currentTab() === tab} - activeServer={tab.server === server.key} - forceTruncate={tabsAreOverflowing()} - /> - - ) - }} - - - {(_) => { - let ref!: HTMLDivElement - - onMount(() => { - ref.scrollIntoView({ behavior: "instant" }) - }) - - return ( - <> -
- { - const tab = tabsStore.at(-1) - if (tab) navigateTab(tab) - else navigate("/") - }} - /> - - ) - }} - + return ( + <> +
+ { + const tab = tabsStore.at(-1) + if (tab) navigateTab(tab) + else navigate("/") + }} + /> + + ) + }} +