diff --git a/frontend/app/store/global.ts b/frontend/app/store/global.ts index 45eca2f2c..cbd56ec52 100644 --- a/frontend/app/store/global.ts +++ b/frontend/app/store/global.ts @@ -43,9 +43,6 @@ function setPlatform(platform: NodeJS.Platform) { PLATFORM = platform; } -// Used to override the tab id when switching tabs to prevent flicker in the tab bar. -const overrideStaticTabAtom = atom(null) as PrimitiveAtom; - function initGlobalAtoms(initOpts: GlobalInitOptions) { const windowIdAtom = atom(initOpts.windowId) as PrimitiveAtom; const clientIdAtom = atom(initOpts.clientId) as PrimitiveAtom; @@ -658,10 +655,6 @@ function createTab() { } function setActiveTab(tabId: string) { - // We use this hack to prevent a flicker of the previously-hovered tab when this view was last active. This class is set in setActiveTab in global.ts. See tab.scss for where this class is used. - // Also overrides the staticTabAtom to the new tab id so that the active tab is set correctly. - globalStore.set(overrideStaticTabAtom, tabId); - document.body.classList.add("nohover"); getApi().setActiveTab(tabId); } @@ -688,7 +681,6 @@ export { isDev, loadConnStatus, openLink, - overrideStaticTabAtom, PLATFORM, pushFlashError, pushNotification, diff --git a/frontend/wave.ts b/frontend/wave.ts index 497bbae12..deca51ae7 100644 --- a/frontend/wave.ts +++ b/frontend/wave.ts @@ -22,7 +22,6 @@ import { initGlobal, initGlobalWaveEventSubs, loadConnStatus, - overrideStaticTabAtom, pushFlashError, pushNotification, removeNotificationById, @@ -89,16 +88,15 @@ async function reinitWave() { console.log("Reinit Wave"); getApi().sendLog("Reinit Wave"); - // We use this hack to prevent a flicker of the previously-hovered tab when this view was last active. This class is set in setActiveTab in global.ts. See tab.scss for where this class is used. - // Also overrides the staticTabAtom to the new tab id so that the active tab is set correctly. - globalStore.set(overrideStaticTabAtom, savedInitOpts.tabId); + // We use this hack to prevent a flicker of the previously-hovered tab when this view was last active. + document.body.classList.add("nohover"); requestAnimationFrame(() => setTimeout(() => { document.body.classList.remove("nohover"); }, 100) ); - const client = await WOS.reloadWaveObject(WOS.makeORef("client", savedInitOpts.clientId)); + await WOS.reloadWaveObject(WOS.makeORef("client", savedInitOpts.clientId)); const waveWindow = await WOS.reloadWaveObject(WOS.makeORef("window", savedInitOpts.windowId)); const ws = await WOS.reloadWaveObject(WOS.makeORef("workspace", waveWindow.workspaceid)); const initialTab = await WOS.reloadWaveObject(WOS.makeORef("tab", savedInitOpts.tabId));