diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index 49e3abe4d..07b273f39 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -58,7 +58,6 @@ var gZenUIManager = { }); window.addEventListener('TabClose', this.onTabClose.bind(this)); - this.tabsWrapper.addEventListener('scroll', this.saveScrollbarState.bind(this)); gZenMediaController.init(); }, diff --git a/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs b/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs index 1a6efa5af..e4979b1e4 100644 --- a/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs +++ b/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs @@ -181,7 +181,11 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent { } async installTheme(theme) { - await this.downloadThemeFileContents(theme); + try { + await this.downloadThemeFileContents(theme); + } catch (e) { + console.error('ZenThemeMarketplaceParent: Error installing theme', theme.id, e); + } } async checkForThemeChanges() { diff --git a/src/zen/workspaces/ZenWorkspaceIcons.mjs b/src/zen/workspaces/ZenWorkspaceIcons.mjs index d51ac9e51..18a91f7fa 100644 --- a/src/zen/workspaces/ZenWorkspaceIcons.mjs +++ b/src/zen/workspaces/ZenWorkspaceIcons.mjs @@ -51,22 +51,25 @@ } } - on_ZenWorkspacesUIUpdate(event) { - this.#updateIcons(); + async on_ZenWorkspacesUIUpdate(event) { + await this.#updateIcons(); this.activeIndex = event.detail.activeIndex; } set activeIndex(uuid) { const buttons = this.querySelectorAll('toolbarbutton'); + if (!buttons.length) { + return; + } let i = 0; - let selected = 0; + let selected = -1; for (const button of buttons) { if (button.getAttribute('zen-workspace-id') == uuid) { selected = i; } else { button.removeAttribute('active'); } - selected++; + i++; } buttons[selected].setAttribute('active', true); this.setAttribute('selected', selected); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 980504202..1339eebf1 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -1594,12 +1594,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { browser.gZenWorkspaces._workspaceBookmarksCache = null; } let workspaces = await browser.gZenWorkspaces._workspaces(); - browser.dispatchEvent( - new CustomEvent('ZenWorkspacesUIUpdate', { - bubbles: true, - detail: { workspaces, activeIndex: browser.gZenWorkspaces.activeWorkspace }, - }) - ); + if (clearCache) { + browser.dispatchEvent( + new CustomEvent('ZenWorkspacesUIUpdate', { + bubbles: true, + detail: { activeIndex: browser.gZenWorkspaces.activeWorkspace }, + }) + ); + } await browser.gZenWorkspaces.workspaceBookmarks(); workspaceList.innerHTML = ''; workspaceList.parentNode.style.display = 'flex'; @@ -2102,7 +2104,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { element, { transform: existingTransform ? [existingTransform, newTransform] : newTransform, - paddingTop: existingTransform ? [existingPaddingTop, existingPaddingTop] : existingPaddingTop, + paddingTop: existingTransform + ? [existingPaddingTop, existingPaddingTop] + : existingPaddingTop, }, { type: 'spring', @@ -2441,8 +2445,16 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { tab.setAttribute('zen-workspace-id', workspace.uuid); } } + window.dispatchEvent( + new CustomEvent('ZenWorkspacesUIUpdate', { + bubbles: true, + detail: { activeIndex: workspace.uuid }, + }) + ); } + this.workspaceIcons.activeIndex = workspace.uuid; + setTimeout(gURLBar.formatValue.bind(gURLBar), 0); } diff --git a/src/zen/workspaces/zen-workspaces.css b/src/zen/workspaces/zen-workspaces.css index fae13285c..0b2aa2c35 100644 --- a/src/zen/workspaces/zen-workspaces.css +++ b/src/zen/workspaces/zen-workspaces.css @@ -11,7 +11,9 @@ align-items: center; display: flex; font-size: x-small; - margin: 0 5px; + padding: 0 3px; + margin: 0; + appearance: auto; position: relative;