This commit is contained in:
Manav Rathi 2024-04-13 08:18:11 +05:30
parent db96a0eb1b
commit f2aee30f7c
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -172,9 +172,9 @@ class DownloadManagerImpl {
if (!this.ready) {
throw Error(CustomError.DOWNLOAD_MANAGER_NOT_READY);
}
const cachedThumb = await this.getCachedThumbnail(file.id);
const cachedThumb = await this.thumbnailCache.get(`${file.id}`);
if (cachedThumb) {
return cachedThumb;
return new Uint8Array(await cachedThumb.arrayBuffer());
}
if (localOnly) {
return null;

View file

@ -110,6 +110,10 @@ export const openCache = async (
*
* Also note that a File is a Blob!
*
* To convert from a Blob to ArrayBuffer
*
* await blob.arrayBuffer()
*
* Refs:
* - https://github.com/yigitunallar/arraybuffer-vs-blob
* - https://stackoverflow.com/questions/11821096/what-is-the-difference-between-an-arraybuffer-and-a-blob