From 1daa0f3e07ae30bd91ec17ad3438648259b35ea2 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 26 Sep 2024 17:31:15 +0530 Subject: [PATCH] Proxy --- web/packages/base/crypto/index.ts | 4 +++- web/packages/base/crypto/worker.ts | 1 + web/packages/new/photos/components/Gallery/index.tsx | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/packages/base/crypto/index.ts b/web/packages/base/crypto/index.ts index 48f7a9526b..6aa95a1f9c 100644 --- a/web/packages/base/crypto/index.ts +++ b/web/packages/base/crypto/index.ts @@ -140,7 +140,9 @@ export const encryptBlob = (data: BytesOrB64, key: BytesOrB64) => * strings. */ export const encryptBlobB64 = (data: BytesOrB64, key: BytesOrB64) => - assertInWorker(ei._encryptBlobB64(data, key)); + inWorker() + ? ei._encryptBlobB64(data, key) + : sharedCryptoWorker().then((w) => w._encryptBlobB64(data, key)); /** * Encrypt the thumbnail for a file. diff --git a/web/packages/base/crypto/worker.ts b/web/packages/base/crypto/worker.ts index b348d6a299..36d5a51a09 100644 --- a/web/packages/base/crypto/worker.ts +++ b/web/packages/base/crypto/worker.ts @@ -15,6 +15,7 @@ import * as libsodium from "./libsodium"; export class CryptoWorker { encryptBoxB64 = ei._encryptBoxB64; encryptThumbnail = ei._encryptThumbnail; + _encryptBlobB64 = ei._encryptBlobB64; encryptMetadataJSON_New = ei._encryptMetadataJSON_New; encryptMetadataJSON = ei._encryptMetadataJSON; decryptBox = ei._decryptBox; diff --git a/web/packages/new/photos/components/Gallery/index.tsx b/web/packages/new/photos/components/Gallery/index.tsx index c0de350e97..ecc648840d 100644 --- a/web/packages/new/photos/components/Gallery/index.tsx +++ b/web/packages/new/photos/components/Gallery/index.tsx @@ -80,7 +80,6 @@ export const PeopleHeader: React.FC = ({ /> ) : (