multiple schedule suppport kinda

This commit is contained in:
Sriram Hariharan
2023-03-15 23:54:07 -05:00
parent 6d4a4307cf
commit 6afd372945
30 changed files with 224 additions and 155 deletions

View File

@@ -1,24 +1,22 @@
import { DevStore } from 'src/shared/storage/DevStore';
import { devStore } from 'src/shared/storage/devStore';
/**
* Open the debug tab as the first tab
*/
export async function openDebugTab() {
if (process.env.NODE_ENV === 'development') {
const debugTabId = await DevStore.getDebugTabId();
const { debugTabId, wasDebugTabVisible } = await devStore.get(['debugTabId', 'wasDebugTabVisible']);
const isAlreadyOpen = await (await chrome.tabs.query({})).some(tab => tab.id === debugTabId);
if (isAlreadyOpen) return;
const wasVisible = await DevStore.getWasDebugTabVisible();
const tab = await chrome.tabs.create({
url: chrome.runtime.getURL('debug.html'),
active: wasVisible,
active: wasDebugTabVisible,
pinned: true,
index: 0,
});
await DevStore.setDebugTabId(tab.id);
await devStore.set('debugTabId', tab.id);
}
}