Skip to content

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

editor: remove attachment progress once it reaches 100

Abdullah Atta95666bee36f2
diff --git a/packages/editor/src/extensions/attachment/attachment.ts b/packages/editor/src/extensions/attachment/attachment.ts
index 124e00fe0..11b4e49dc 100644
--- a/packages/editor/src/extensions/attachment/attachment.ts
+++ b/packages/editor/src/extensions/attachment/attachment.ts
@@ -160,9 +160,12 @@ export const AttachmentNode = Node.create<AttachmentOptions>({
if (!attachments.length) return false;
for (const { node, pos } of attachments) {
+ const progress = attachment.progress || node.attrs.progress;
tr.setNodeMarkup(pos, node.type, {
...node.attrs,
- ...attachment
+ ...attachment,
+ progress:
+ progress !== undefined && progress < 100 ? progress : undefined
});
}
tr.setMeta("preventUpdate", options.preventUpdate || false);