Refactor ZenPinnedTabManager and ZenPinnedTabsStorage initialization

This commit is contained in:
mr. M 2024-11-03 16:46:22 +01:00
parent 9d41110b8b
commit 2adc19bc21
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
2 changed files with 6 additions and 3 deletions

View file

@ -41,8 +41,7 @@
async init() { async init() {
this.observer = new ZenPinnedTabsObserver(); this.observer = new ZenPinnedTabsObserver();
await ZenPinnedTabsStorage.init(); await ZenPinnedTabsStorage.init();
// TODO: Figure out if this is even needed - for now it's commented out await SessionStore.promiseInitialized;
// await SessionStore.promiseInitialized;
await this._refreshPinnedTabs(); await this._refreshPinnedTabs();
this._initClosePinnedTabShortcut(); this._initClosePinnedTabShortcut();
this._insertItemsIntoTabContextMenu(); this._insertItemsIntoTabContextMenu();

View file

@ -1,7 +1,11 @@
var ZenPinnedTabsStorage = { var ZenPinnedTabsStorage = {
async init() { async init() {
console.log('ZenPinnedTabsStorage: Initializing...'); console.log('ZenPinnedTabsStorage: Initializing...');
try {
await this._ensureTable(); await this._ensureTable();
} catch (e) {
console.warn('ZenPinnedTabsStorage: Failed to initialize', e);
}
}, },
async _ensureTable() { async _ensureTable() {