Fix Db initialisation issue
This commit is contained in:
parent
62c8d95ea3
commit
bcf405e3c5
@ -72,9 +72,11 @@ class Database {
|
||||
};
|
||||
|
||||
request.onsuccess = () => {
|
||||
this.db = request.result;
|
||||
this.initServiceWorker();
|
||||
resolve();
|
||||
setTimeout(() => {
|
||||
this.db = request.result;
|
||||
this.initServiceWorker();
|
||||
resolve();
|
||||
}, 0);
|
||||
};
|
||||
|
||||
request.onerror = () => {
|
||||
@ -111,9 +113,8 @@ class Database {
|
||||
const registration = await navigator.serviceWorker.register('/src/service-workers/database.worker.js', { type: 'module' });
|
||||
console.log('Service Worker registered with scope:', registration.scope);
|
||||
|
||||
this.serviceWorkerRegistration = registration;
|
||||
|
||||
this.checkForUpdates();
|
||||
this.serviceWorkerRegistration = registration
|
||||
await this.checkForUpdates();
|
||||
|
||||
// Set up the message channels
|
||||
this.messageChannel.port1.onmessage = this.handleAddObjectResponse;
|
||||
|
Loading…
x
Reference in New Issue
Block a user