mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-19 04:31:46 +00:00
fix a bug causing right click to copy a note
This commit is contained in:
@@ -519,7 +519,7 @@ class NoteList extends React.Component {
|
|||||||
click: this.cloneNote.bind(this)
|
click: this.cloneNote.bind(this)
|
||||||
}, {
|
}, {
|
||||||
label: copyNoteLink,
|
label: copyNoteLink,
|
||||||
click: this.copyNoteLink(note)
|
click: this.copyNoteLink
|
||||||
})
|
})
|
||||||
if (note.type === 'MARKDOWN_NOTE') {
|
if (note.type === 'MARKDOWN_NOTE') {
|
||||||
if (note.blog && note.blog.blogLink && note.blog.blogId) {
|
if (note.blog && note.blog.blogLink && note.blog.blogId) {
|
||||||
@@ -684,8 +684,11 @@ class NoteList extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
copyNoteLink (note) {
|
copyNoteLink () {
|
||||||
const noteLink = `[${note.title}](:note:${note.key})`
|
const { selectedNoteKeys } = this.state
|
||||||
|
const notes = this.notes.map((note) => Object.assign({}, note))
|
||||||
|
const selectedNote = findNotesByKeys(notes, selectedNoteKeys)[0]
|
||||||
|
const noteLink = `[${selectedNote.title}](:note:${selectedNote.key})`
|
||||||
return copy(noteLink)
|
return copy(noteLink)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user