mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
fs: add support for getting actual file size
This commit is contained in:
committed by
Abdullah Atta
parent
1a0c94896a
commit
85484b1762
@@ -92,4 +92,14 @@ export default class FileHandle {
|
||||
}
|
||||
return new Blob(blobParts, { type: this.file.type });
|
||||
}
|
||||
|
||||
async size() {
|
||||
let size = 0;
|
||||
for (let i = 0; i < this.file.chunks; ++i) {
|
||||
const array = await this.readChunk(i);
|
||||
if (!array) continue;
|
||||
size += array.length;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user