fix: Fixed rearranging tabs from pinned to normal, b=(no-bug), c=workspaces

This commit is contained in:
Mr. M
2025-05-17 23:29:25 +02:00
parent e712e8204d
commit 7c1bdbfa68
2 changed files with 10 additions and 3 deletions

View File

@@ -2539,13 +2539,15 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async updateTabsContainers(target = undefined, forAnimation = false) {
if (target && !target.parentNode) {
if (target && !target.target?.parentNode) {
target = null;
}
// Only animate if it's from an event
const animateContainer = target && target instanceof EventTarget;
const animateContainer = target && target.target instanceof EventTarget;
await this.onPinnedTabsResize(
[{ target: target ?? this.pinnedTabsContainer }],
// This is what happens when we join a resize observer, an event listener
// while using it as a method.
[{ target: (target?.target ? target.target : target) ?? this.pinnedTabsContainer }],
forAnimation,
animateContainer
);