Skip to content

Commit df3b2cd

Browse files
committed
fix double paste when pasting attachement links
1 parent 2aa296f commit df3b2cd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

browser/components/CodeEditor.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ export default class CodeEditor extends React.Component {
645645
}
646646

647647
const pastedTxt = clipboard.readText()
648+
console.log(pastedTxt)
648649

649650
if (isInFencedCodeBlock(editor)) {
650651
this.handlePasteText(editor, pastedTxt)
@@ -667,16 +668,14 @@ export default class CodeEditor extends React.Component {
667668
this.handlePasteText(editor, pastedTxt)
668669
}
669670
}
670-
} else {
671-
this.handlePasteText(editor, pastedTxt)
672-
}
673-
674-
if (attachmentManagement.isAttachmentLink(pastedTxt)) {
671+
} else if (attachmentManagement.isAttachmentLink(pastedTxt)) {
675672
attachmentManagement
676673
.handleAttachmentLinkPaste(storageKey, noteKey, pastedTxt)
677674
.then(modifiedText => {
678675
this.editor.replaceSelection(modifiedText)
679676
})
677+
} else {
678+
this.handlePasteText(editor, pastedTxt)
680679
}
681680
}
682681

0 commit comments

Comments
 (0)