diff --git a/web/packages/new/photos/services/download.ts b/web/packages/new/photos/services/download.ts index ef41873f39..c9cfa38802 100644 --- a/web/packages/new/photos/services/download.ts +++ b/web/packages/new/photos/services/download.ts @@ -56,16 +56,12 @@ class DownloadManagerImpl { private fileObjectURLPromises = new Map>(); private fileConversionPromises = new Map>(); - private thumbnailObjectURLPromises = new Map>(); + private thumbnailObjectURLPromises = new Map>(); private fileDownloadProgress = new Map(); private progressUpdater: (value: Map) => void = () => {}; - private ensureClient() { - return ensure(this.downloadClient); - } - async init(token?: string) { if (this.ready) { log.info("DownloadManager already initialized"); @@ -140,14 +136,14 @@ class DownloadManagerImpl { const key = file.id.toString(); const cached = await this.thumbnailCache?.get(key); if (cached) return new Uint8Array(await cached.arrayBuffer()); - if (localOnly) return null; + if (localOnly) return undefined; const thumb = await this.downloadThumb(file); await this.thumbnailCache?.put(key, new Blob([thumb])); return thumb; } - async getThumbnailForPreview(file: EnteFile, localOnly = false) { + async getThumbnailForPreview(file: EnteFile, localOnly = false): Promise { this.ensureInitialized(); try { if (!this.thumbnailObjectURLPromises.has(file.id)) {