fix: Default assign an array instead of an object to the workspaces cache, b=no-bug, c=workspaces

This commit is contained in:
mr. m
2025-12-16 22:15:14 +01:00
parent 980a4b7d56
commit 7ddace35f9
2 changed files with 5 additions and 4 deletions

View File

@@ -784,7 +784,7 @@ class nsZenWindowSync {
);
const selectedTab = aWindow.gBrowser.selectedTab;
let win = [...this.#browserWindows][0];
const moveAllTabsToWindow = (allowSelected = false) => {
const moveAllTabsToWindow = async (allowSelected = false) => {
const { gBrowser, gZenWorkspaces } = win;
win.focus();
let success = true;
@@ -804,7 +804,8 @@ class nsZenWindowSync {
}
if (success) {
aWindow.close();
win.gBrowser.selectedTab.linkedBrowser.focus();
await gZenWorkspaces.changeWorkspaceWithID(aWorkspaceId);
gBrowser.selectedBrowser.focus();
}
};
if (!win) {

View File

@@ -23,7 +23,7 @@ class nsZenWorkspaces {
direction: null,
};
_workspaceCache = {};
_workspaceCache = [];
#lastScrollTime = 0;
@@ -806,7 +806,7 @@ class nsZenWorkspaces {
getWorkspaceFromId(id) {
try {
return this._workspaceCache.find((workspace) => workspace.uuid === id);
return this.getWorkspaces().find((workspace) => workspace.uuid === id);
} catch {
return null;
}