Page MenuHomePhorge

D10306.1765103886.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D10306.1765103886.diff

diff --git a/web/database/database-module-provider.js b/web/database/database-module-provider.js
--- a/web/database/database-module-provider.js
+++ b/web/database/database-module-provider.js
@@ -47,6 +47,11 @@
return;
}
+ if (this.status.type === databaseStatuses.initInProgress) {
+ await this.status.initPromise;
+ return;
+ }
+
if (clearDatabase && this.status.type === databaseStatuses.initSuccess) {
console.info('Clearing sensitive data');
invariant(this.workerProxy, 'Worker proxy should exist');
@@ -56,28 +61,23 @@
this.status = { type: databaseStatuses.notRunning };
}
- if (this.status.type === databaseStatuses.initInProgress) {
- await this.status.initPromise;
- return;
- }
-
- if (
- this.status.type === databaseStatuses.initSuccess ||
- this.status.type === databaseStatuses.initError
- ) {
- return;
- }
+ const initPromise = (async () => {
+ if (
+ this.status.type === databaseStatuses.initSuccess ||
+ this.status.type === databaseStatuses.initError
+ ) {
+ return;
+ }
- this.worker = new SharedWorker(DATABASE_WORKER_PATH);
- this.worker.onerror = console.error;
- this.workerProxy = new WorkerConnectionProxy(
- this.worker.port,
- console.error,
- );
+ this.worker = new SharedWorker(DATABASE_WORKER_PATH);
+ this.worker.onerror = console.error;
+ this.workerProxy = new WorkerConnectionProxy(
+ this.worker.port,
+ console.error,
+ );
- const origin = window.location.origin;
+ const origin = window.location.origin;
- const initPromise = (async () => {
try {
let encryptionKey = null;
if (isDesktopSafari) {

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 10:38 AM (1 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5843724
Default Alt Text
D10306.1765103886.diff (1 KB)

Event Timeline