mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
core: check for file existence before calling downloadFile
This commit is contained in:
committed by
Ammar Ahmed
parent
e62267042e
commit
1f2948c9a5
@@ -36,6 +36,16 @@ export default class FileStorage {
|
||||
this.downloads.set(groupId, files);
|
||||
for (const file of files) {
|
||||
const { filename, metadata, chunkSize } = file;
|
||||
if (await this.exists(filename)) {
|
||||
EV.publish(EVENTS.fileDownloaded, {
|
||||
success: true,
|
||||
groupId,
|
||||
filename,
|
||||
eventData
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
const url = `${hosts.API_HOST}/s3?name=${filename}`;
|
||||
const { execute, cancel } = this.fs.downloadFile(filename, {
|
||||
metadata,
|
||||
|
||||
Reference in New Issue
Block a user