feat: Fixed issue with workspace changes getting stuck, b=bug #9334, c=common, compact-mode, glance, split-view, tests, workspaces

This commit is contained in:
Mr. M
2025-09-17 16:08:55 +02:00
parent 801533bf26
commit 16ec5b36c1
10 changed files with 74 additions and 58 deletions

View File

@@ -2107,7 +2107,13 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
gZenUIManager._preventToolbarRebuild = true;
gZenUIManager.updateTabsToolbar();
}
await Promise.all(animations);
let promiseTimeout = new Promise((resolve) =>
setTimeout(resolve, kGlobalAnimationDuration * 1000 + 50)
);
// See issue https://github.com/zen-browser/desktop/issues/9334, we need to add
// some sort of timeout to the animation promise, just in case it gets stuck.
// We are doing a race between the timeout and the animations finishing.
await Promise.race([Promise.all(animations), promiseTimeout]).catch(console.error);
document.documentElement.removeAttribute('animating-background');
if (shouldAnimate) {
for (const cloned of clonedEssentials) {