π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[web] Fix race condition in initialization of search worker
Manav Rathi97b964fd6cfd
diff --git a/web/apps/photos/src/utils/comlink/ComlinkSearchWorker.ts b/web/apps/photos/src/utils/comlink/ComlinkSearchWorker.tsindex 4886bacda5..0d7c52a965 100644--- a/web/apps/photos/src/utils/comlink/ComlinkSearchWorker.ts+++ b/web/apps/photos/src/utils/comlink/ComlinkSearchWorker.ts@@ -5,11 +5,13 @@ import { type DedicatedSearchWorker } from "worker/search.worker";class ComlinkSearchWorker {private comlinkWorkerInstance: Remote<DedicatedSearchWorker>;+ private comlinkWorker: ComlinkWorker<typeof DedicatedSearchWorker>;async getInstance() {if (!this.comlinkWorkerInstance) {- this.comlinkWorkerInstance =- await getDedicatedSearchWorker().remote;+ if (!this.comlinkWorker)+ this.comlinkWorker = getDedicatedSearchWorker();+ this.comlinkWorkerInstance = await this.comlinkWorker.remote;}return this.comlinkWorkerInstance;}