Skip to content

Commit 6632432

Browse files
committed
feat: Prevent zen's session restore from being removed, b=(no-bug), c=common
1 parent 03ca007 commit 6632432

File tree

1 file changed

+1
-53
lines changed

1 file changed

+1
-53
lines changed

src/zen/common/ZenSessionStore.mjs

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
this.#waitAndCleanup();
88
}
99

10-
#glanceTabs = {};
1110
promiseInitialized = new Promise((resolve) => {
1211
this._resolveInitialized = resolve;
1312
});
@@ -34,67 +33,16 @@
3433
if (tabData.zenPinnedEntry) {
3534
tab.setAttribute('zen-pinned-entry', tabData.zenPinnedEntry);
3635
}
37-
if (tabData.zenGlanceId) {
38-
// We just found the background used for glance. Find
39-
// the current
40-
if (tabData.zenIsGlance) {
41-
if (this.#glanceTabs[tabData.zenGlanceId]) {
42-
this.#glanceTabs[tabData.zenGlanceId].tab = tab;
43-
} else {
44-
this.#glanceTabs[tabData.zenGlanceId] = {
45-
tab: tab,
46-
background: null,
47-
};
48-
}
49-
} else {
50-
if (this.#glanceTabs[tabData.zenGlanceId]) {
51-
this.#glanceTabs[tabData.zenGlanceId].background = tab;
52-
} else {
53-
this.#glanceTabs[tabData.zenGlanceId] = {
54-
tab: null,
55-
background: tab,
56-
};
57-
}
58-
}
59-
}
60-
}
61-
62-
async #resolveGlanceTabs() {
63-
for (const [id, data] of Object.entries(this.#glanceTabs)) {
64-
const { tab, background } = data;
65-
// TODO(Restore glance tab): Finish this implementation
66-
continue;
67-
68-
if (!tab || !background) {
69-
tab?.removeAttribute('glance-id');
70-
background?.removeAttribute('glance-id');
71-
continue;
72-
}
73-
console.log(tab, background);
74-
const browserRect = gBrowser.tabbox.getBoundingClientRect();
75-
await gZenGlanceManager.openGlance(
76-
{
77-
url: undefined,
78-
clientX: browserRect.width / 2,
79-
clientY: browserRect.height / 2,
80-
width: 0,
81-
height: 0,
82-
},
83-
tab,
84-
background
85-
);
86-
}
8736
}
8837

8938
async #waitAndCleanup() {
9039
await SessionStore.promiseAllWindowsRestored;
91-
await this.#resolveGlanceTabs();
40+
await SessionStore.promiseInitialized;
9241
this.#cleanup();
9342
}
9443

9544
#cleanup() {
9645
this._resolveInitialized();
97-
delete window.gZenSessionStore;
9846
}
9947
}
10048

0 commit comments

Comments
 (0)