get
This commit is contained in:
parent
db96a0eb1b
commit
f2aee30f7c
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue