Fix init bugs
This commit is contained in:
parent
77019896e5
commit
1025c907b5
@ -1,3 +1,9 @@
|
||||
// Polyfill to prevent "chrome is not defined" errors
|
||||
// Some dependencies may check for Chrome extension APIs without proper existence checks
|
||||
if (typeof (globalThis as any).chrome === 'undefined') {
|
||||
(globalThis as any).chrome = {};
|
||||
}
|
||||
|
||||
import Services from './services/service';
|
||||
import { Router } from './router/index';
|
||||
import './components/header/Header';
|
||||
|
||||
@ -148,7 +148,7 @@ export class Database {
|
||||
|
||||
if (this.serviceWorkerCheckIntervalId)
|
||||
clearInterval(this.serviceWorkerCheckIntervalId);
|
||||
this.serviceWorkerCheckIntervalId = window.setInterval(async () => {
|
||||
this.serviceWorkerCheckIntervalId = setInterval(async () => {
|
||||
const activeWorker =
|
||||
this.serviceWorkerRegistration?.active ||
|
||||
(await this.waitForServiceWorkerActivation(
|
||||
@ -159,7 +159,7 @@ export class Database {
|
||||
if (payload && payload.length != 0) {
|
||||
activeWorker?.postMessage({ type: "SCAN", payload });
|
||||
}
|
||||
}, 5000);
|
||||
}, 5000) as unknown as number;
|
||||
} catch (error) {
|
||||
console.error("[Database] Service Worker error:", error);
|
||||
}
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
// Polyfill to prevent "chrome is not defined" errors in worker context
|
||||
if (typeof (globalThis as any).chrome === 'undefined') {
|
||||
(globalThis as any).chrome = {};
|
||||
}
|
||||
|
||||
import * as Comlink from "comlink";
|
||||
import {
|
||||
ApiReturn,
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
// Polyfill to prevent "chrome is not defined" errors in worker context
|
||||
if (typeof (globalThis as any).chrome === 'undefined') {
|
||||
(globalThis as any).chrome = {};
|
||||
}
|
||||
|
||||
import * as Comlink from 'comlink';
|
||||
import { APP_CONFIG } from '../config/constants';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user