mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
refactor: Remove redundant tab refresh during initialization and streamline workspace startup process
This commit is contained in:
@@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
async initTabs() {
|
async initTabs() {
|
||||||
await ZenPinnedTabsStorage.init();
|
await ZenPinnedTabsStorage.init();
|
||||||
await this._refreshPinnedTabs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _refreshPinnedTabs() {
|
async _refreshPinnedTabs() {
|
||||||
|
@@ -47,6 +47,8 @@ var ZenPinnedTabsStorage = {
|
|||||||
await db.execute(`
|
await db.execute(`
|
||||||
CREATE INDEX IF NOT EXISTS idx_zen_pins_changes_uuid ON zen_pins_changes(uuid)
|
CREATE INDEX IF NOT EXISTS idx_zen_pins_changes_uuid ON zen_pins_changes(uuid)
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
await gZenPinnedTabManager._refreshPinnedTabs();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -34,10 +34,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
|
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
|
||||||
this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', '');
|
this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', '');
|
||||||
await ZenWorkspacesStorage.init();
|
await ZenWorkspacesStorage.init();
|
||||||
if (!Weave.Service.engineManager.get('workspaces')) {
|
|
||||||
Weave.Service.engineManager.register(ZenWorkspacesEngine);
|
|
||||||
await ZenWorkspacesStorage.migrateWorkspacesFromJSON();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _delayedStartup() {
|
||||||
await this.initializeWorkspaces();
|
await this.initializeWorkspaces();
|
||||||
console.info('ZenWorkspaces: ZenWorkspaces initialized');
|
console.info('ZenWorkspaces: ZenWorkspaces initialized');
|
||||||
|
|
||||||
|
@@ -58,6 +58,13 @@ var ZenWorkspacesStorage = {
|
|||||||
await db.execute(`
|
await db.execute(`
|
||||||
CREATE INDEX IF NOT EXISTS idx_zen_workspaces_changes_uuid ON zen_workspaces_changes(uuid)
|
CREATE INDEX IF NOT EXISTS idx_zen_workspaces_changes_uuid ON zen_workspaces_changes(uuid)
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
if (!Weave.Service.engineManager.get('workspaces')) {
|
||||||
|
Weave.Service.engineManager.register(ZenWorkspacesEngine);
|
||||||
|
await ZenWorkspacesStorage.migrateWorkspacesFromJSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
ZenWorkspaces._delayedStartup();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user