Skip to content

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

fix: don't send 0-indexed progress

thecodrr3e184345a351
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index a230f4bcc..f8284b566 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);
+ sendAttachmentsProgressEvent("upload", hash, attachments.length, i + 1);
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 375204e16..6a4f5e011 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -198,7 +198,7 @@ export default class Attachments extends Collection {
}
async _downloadMedia(hash, { total, current, groupId }, notify = true) {
- sendAttachmentsProgressEvent("download", groupId, total, current);
+ sendAttachmentsProgressEvent("download", groupId, total, current + 1);
const isDownloaded = await this._db.fs.downloadFile(groupId, hash);
if (!isDownloaded) return;