mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
show delete confirmation dialog
This commit is contained in:
@@ -175,6 +175,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
handleTrashButtonClick (e) {
|
||||
const { note } = this.state
|
||||
const { isTrashed } = note
|
||||
const { config } = this.props
|
||||
|
||||
if (isTrashed) {
|
||||
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||
@@ -198,6 +199,16 @@ class SnippetNoteDetail extends React.Component {
|
||||
ee.once('list:moved', dispatchHandler)
|
||||
})
|
||||
} else {
|
||||
if (config.ui.confirmDeletion) {
|
||||
const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||
type: 'warning',
|
||||
message: 'Confirm note deletion',
|
||||
detail: 'Are you sure you want to move the note to the trash?',
|
||||
buttons: ['Confirm', 'Cancel']
|
||||
})
|
||||
if (dialogueButtonIndex === 1) return
|
||||
}
|
||||
|
||||
note.isTrashed = true
|
||||
|
||||
this.setState({
|
||||
|
||||
Reference in New Issue
Block a user