feat: Make sure to add checks for invalid essential items, b=no-bug, c=workspaces

This commit is contained in:
mr. m
2026-03-11 00:57:38 +01:00
parent eb176edf8b
commit 23ceaf7721
2 changed files with 8 additions and 8 deletions

View File

@@ -1229,6 +1229,10 @@
let showIndicatorUnderNewTabButton = false;
let dropBefore = false;
let dropElementFromEvent = event.target.closest(dropZoneSelector);
if (!dropElement && dropElementFromEvent?.isZenFolder) {
// If we're dragging over a folder, we want to show the indicator on the folder itself, not the label.
dropElementFromEvent = dropElementFromEvent.labelElement;
}
dropElement = dropElementFromEvent || dropElement;
if (!dropElementFromEvent) {
let hoveringPeriphery = !!event.target.closest(

View File

@@ -2072,14 +2072,10 @@ class nsZenWorkspaces {
const essentialsContainer = this.getEssentialsSection(
workspace.containerTabId
);
if (
clonedEssentials[clonedEssentials.length - 1]?.contextId ==
workspace.containerTabId
) {
clonedEssentials[clonedEssentials.length - 1].repeat++;
clonedEssentials[clonedEssentials.length - 1].workspaces.push(
workspace
);
let lastCloned = clonedEssentials[clonedEssentials.length - 1];
if (lastCloned && lastCloned.contextId == workspace.containerTabId) {
lastCloned.repeat++;
lastCloned.workspaces.push(workspace);
continue;
}
essentialsContainer.setAttribute("hidden", "true");