fix: a tab for a channel or note that no longer exists closes instead of staying on a spinner (#34294)

This commit is contained in:
G30 authored and GitHub committed 2026-11-17 22:05:37 +09:00
1 parent 97bb6b3223
commit 0132d879c0
1 file changed
+6 -1
+6 -1
View File
@@ -711,8 +711,13 @@
} else openPanel(createPageTab(request));
};
const navigatePageTab = async (id: string, href: string) => {
if (!((await pageViews[id]?.requestClose()) ?? true)) return;
const url = new URL(href, location.origin);
if (url.pathname === '/' && !url.search) {
await closeTab(id);
focusMainChat();
return;
}
if (!((await pageViews[id]?.requestClose()) ?? true)) return;
if (url.pathname === '/' || url.pathname.startsWith('/c/')) {
openPageTab({ href, label: '' });
} else if (viewEntry) updateViewTab(viewEntry, id, { href });