mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix double paste when pasting attachement links
This commit is contained in:
@@ -645,6 +645,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pastedTxt = clipboard.readText()
|
const pastedTxt = clipboard.readText()
|
||||||
|
console.log(pastedTxt)
|
||||||
|
|
||||||
if (isInFencedCodeBlock(editor)) {
|
if (isInFencedCodeBlock(editor)) {
|
||||||
this.handlePasteText(editor, pastedTxt)
|
this.handlePasteText(editor, pastedTxt)
|
||||||
@@ -667,16 +668,14 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.handlePasteText(editor, pastedTxt)
|
this.handlePasteText(editor, pastedTxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if (attachmentManagement.isAttachmentLink(pastedTxt)) {
|
||||||
this.handlePasteText(editor, pastedTxt)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attachmentManagement.isAttachmentLink(pastedTxt)) {
|
|
||||||
attachmentManagement
|
attachmentManagement
|
||||||
.handleAttachmentLinkPaste(storageKey, noteKey, pastedTxt)
|
.handleAttachmentLinkPaste(storageKey, noteKey, pastedTxt)
|
||||||
.then(modifiedText => {
|
.then(modifiedText => {
|
||||||
this.editor.replaceSelection(modifiedText)
|
this.editor.replaceSelection(modifiedText)
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.handlePasteText(editor, pastedTxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user