Skip to content

Commit e312e3f

Browse files
committed
fix: Fixed moving folders with sub-folders into new spaces, b=no-bug, c=folders
1 parent 70aeeba commit e312e3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/zen/folders/ZenFolders.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,11 @@
761761
const workspaceElement = gZenWorkspaces.workspaceElement(workspaceId);
762762
const pinnedTabsContainer = workspaceElement.pinnedTabsContainer;
763763
pinnedTabsContainer.insertBefore(folder, pinnedTabsContainer.lastChild);
764-
folder.setAttribute('zen-workspace-id', workspaceId);
765764
for (const tab of folder.tabs) {
766765
tab.setAttribute('zen-workspace-id', workspaceId);
766+
// This sets the ID for the current folder and any sub-folder
767+
// we may encounter
768+
tab.group.setAttribute('zen-workspace-id', workspaceId);
767769
gBrowser.TabStateFlusher.flush(tab.linkedBrowser);
768770
if (gZenWorkspaces._lastSelectedWorkspaceTabs[workspaceId] === tab) {
769771
// This tab is no longer the last selected tab in the previous workspace because it's being moved to a new workspace
@@ -772,7 +774,7 @@
772774
}
773775
folder.dispatchEvent(new CustomEvent('ZenFolderChangedWorkspace', { bubbles: true }));
774776
gZenWorkspaces.changeWorkspaceWithID(workspaceId).then(() => {
775-
gBrowser.moveTabTo(folder, { elementIndex: gBrowser.pinnedTabCount, forceUngrouped: true });
777+
gBrowser.moveTabTo(folder, { elementIndex: 0, forceUngrouped: true });
776778
});
777779
}
778780

0 commit comments

Comments
 (0)