mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed session restore for folders with invalid workspace IDs, b=no-bug, c=folders, workspaces
This commit is contained in:
@@ -637,7 +637,7 @@
|
||||
_forZenEmptyTab: true,
|
||||
});
|
||||
|
||||
tabs = [...tabs, emptyTab];
|
||||
tabs = [emptyTab, ...tabs];
|
||||
|
||||
const folder = this._createFolderNode(options);
|
||||
if (options.initialPinId) {
|
||||
@@ -1249,7 +1249,7 @@
|
||||
if (prevSibling) {
|
||||
if (gBrowser.isTabGroup(prevSibling)) {
|
||||
prevSiblingInfo = { type: 'group', id: prevSibling.id };
|
||||
} else if (gBrowser.isTab(prevSibling)) {
|
||||
} else if (gBrowser.isTab(prevSibling) && prevSibling.hasAttribute('zen-pin-id')) {
|
||||
const zenPinId = prevSibling.getAttribute('zen-pin-id');
|
||||
prevSiblingInfo = { type: 'tab', id: zenPinId };
|
||||
} else {
|
||||
@@ -1318,7 +1318,9 @@
|
||||
workingData.node = oldGroup;
|
||||
}
|
||||
while (oldGroup.tabs.length > 0) {
|
||||
workingData.containingTabsFragment.appendChild(oldGroup.tabs[0]);
|
||||
const tab = oldGroup.tabs[0];
|
||||
tab.setAttribute('zen-workspace-id', folderData.workspaceId);
|
||||
workingData.containingTabsFragment.appendChild(tab);
|
||||
}
|
||||
if (!folderData.splitViewGroup) {
|
||||
oldGroup.remove();
|
||||
|
@@ -494,7 +494,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
workspaceWrapper.addEventListener(
|
||||
'ZenWorkspaceAttached',
|
||||
() => {
|
||||
this._organizeTabsToWorkspaceSections(
|
||||
this.#organizeTabsToWorkspaceSections(
|
||||
workspace,
|
||||
workspaceWrapper.tabsContainer,
|
||||
workspaceWrapper.pinnedTabsContainer,
|
||||
@@ -508,7 +508,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
});
|
||||
}
|
||||
|
||||
_organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
|
||||
#organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
|
||||
const workspaceTabs = Array.from(tabs).filter(
|
||||
(tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid
|
||||
);
|
||||
@@ -545,11 +545,11 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
initializeWorkspaceNavigation() {
|
||||
this._setupAppCommandHandlers();
|
||||
this._setupSidebarHandlers();
|
||||
this.#setupAppCommandHandlers();
|
||||
this.#setupSidebarHandlers();
|
||||
}
|
||||
|
||||
_setupAppCommandHandlers() {
|
||||
#setupAppCommandHandlers() {
|
||||
// Remove existing handler temporarily - this is needed so that _handleAppCommand is called before the original
|
||||
window.removeEventListener('AppCommand', HandleAppCommandEvent, true);
|
||||
|
||||
@@ -591,7 +591,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
});
|
||||
}
|
||||
|
||||
_setupSidebarHandlers() {
|
||||
#setupSidebarHandlers() {
|
||||
const toolbox = gNavToolbox;
|
||||
|
||||
const scrollCooldown = 200; // Milliseconds to wait before allowing another scroll
|
||||
|
Reference in New Issue
Block a user