소스 검색

[web] Allow thumbnail cache to be optional

See: https://github.com/ente-io/ente/discussions/1449#discussioncomment-9255346

I'm not yet sure what was the case why it was not initialized, hoping to get
some logs for the error when initializing the cache to see how we got to this
state. But meanwhile, ensure that the code works even without the cache.
Manav Rathi 1 년 전
부모
커밋
0f46a25a5d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      web/apps/photos/src/services/download/index.ts

+ 1 - 1
web/apps/photos/src/services/download/index.ts

@@ -150,7 +150,7 @@ class DownloadManagerImpl {
         this.ensureInitialized();
         this.ensureInitialized();
 
 
         const key = file.id.toString();
         const key = file.id.toString();
-        const cached = await this.thumbnailCache.get(key);
+        const cached = await this.thumbnailCache?.get(key);
         if (cached) return new Uint8Array(await cached.arrayBuffer());
         if (cached) return new Uint8Array(await cached.arrayBuffer());
         if (localOnly) return null;
         if (localOnly) return null;