Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: attachment progress not showing

thecodrr025b416e3435
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index bb15e2849..136986d71 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -182,7 +182,7 @@ export default class Sync {
for (var i = 0; i < attachments.length; ++i) {
const attachment = attachments[i];
const { hash } = attachment.metadata;
- sendAttachmentsProgressEvent("upload", hash, attachments.length, i + 1);
+ sendAttachmentsProgressEvent("upload", hash, attachments.length, i);
const isUploaded = await this._db.fs.uploadFile(hash, hash);
if (!isUploaded) throw new Error("Failed to upload file.");
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index e87102739..97f1656a4 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -230,7 +230,7 @@ export default class Attachments extends Collection {
{ total, current, groupId },
notify = true
) {
- sendAttachmentsProgressEvent("download", groupId, total, current + 1);
+ sendAttachmentsProgressEvent("download", groupId, total, current);
const isDownloaded = await this._db.fs.downloadFile(
groupId,
hash,