mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-10 18:15:30 +02:00
Fixed essentials and pinned tabs not being correctly restored and race conditions when starting multiple zen windows
This commit is contained in:
parent
e6313c4d5f
commit
8e783f948f
7 changed files with 30 additions and 16 deletions
|
@ -21,6 +21,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
'BMB_mobileBookmarks',
|
||||
];
|
||||
|
||||
promiseDBInitialized = new Promise((resolve) => {
|
||||
this._resolveDBInitialized = resolve;
|
||||
});
|
||||
|
||||
promisePinnedInitialized = new Promise((resolve) => {
|
||||
this._resolvePinnedInitialized = resolve;
|
||||
});
|
||||
|
||||
async waitForPromises() {
|
||||
await SessionStore.promiseInitialized;
|
||||
await this.promiseDBInitialized;
|
||||
await this.promisePinnedInitialized;
|
||||
}
|
||||
|
||||
async init() {
|
||||
if (!this.shouldHaveWorkspaces) {
|
||||
document.getElementById('zen-current-workspace-indicator').setAttribute('hidden', 'true');
|
||||
|
@ -376,7 +390,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
this._initializeWorkspaceTabContextMenus();
|
||||
await this.workspaceBookmarks();
|
||||
window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this));
|
||||
await SessionStore.promiseInitialized;
|
||||
await this.waitForPromises();
|
||||
let workspaces = await this._workspaces();
|
||||
let activeWorkspace = null;
|
||||
if (workspaces.workspaces.length === 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue