added deviceId, ExtensionStore, working on CoursePopup

This commit is contained in:
Sriram Hariharan
2023-03-04 20:33:35 -06:00
parent e99ba5864a
commit 46282a0406
15 changed files with 119 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
import { devStore } from 'src/shared/storage/devStore';
import { DevStore } from 'src/background/storage/DevStore';
/**
* A list of websites that we don't want to reload when the extension reloads (becuase it'd be hella annoying lmao)
@@ -24,7 +24,7 @@ const HOT_RELOADING_WHITELIST = [
* @returns a promise that resolves when the tab is reloaded
*/
export async function hotReloadTab(): Promise<void> {
const { getIsTabReloading, getReloadTabId } = devStore;
const { getIsTabReloading, getReloadTabId } = DevStore;
const [isTabReloading, reloadTabId] = await Promise.all([getIsTabReloading(), getReloadTabId()]);

View File

@@ -1,16 +1,16 @@
import { devStore } from 'src/shared/storage/devStore';
import { DevStore } from 'src/background/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 = await DevStore.getDebugTabId();
const isAlreadyOpen = await (await chrome.tabs.query({})).some(tab => tab.id === debugTabId);
if (isAlreadyOpen) return;
const wasVisible = await devStore.getWasDebugTabVisible();
const wasVisible = await DevStore.getWasDebugTabVisible();
const tab = await chrome.tabs.create({
url: chrome.runtime.getURL('debug.html'),
@@ -19,6 +19,6 @@ export async function openDebugTab() {
index: 0,
});
await devStore.setDebugTabId(tab.id);
await DevStore.setDebugTabId(tab.id);
}
}