mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Change to use sdialog.showMEssageBox() instead of window.alert
This commit is contained in:
@@ -56,10 +56,11 @@ class NewNoteButton extends React.Component {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (storage == null) window.alert('No storage to create a note')
|
||||
let folder = _.find(storage.folders, {key: params.folderKey})
|
||||
if (folder == null) folder = storage.folders[0]
|
||||
if (folder == null) window.alert('No folder to create a note')
|
||||
|
||||
if (storage == null) this.showMessageBox('No storage to create a note')
|
||||
let folder = storage.folders[0]
|
||||
folder = _.find(storage.folders, {key: params.folderKey})
|
||||
if (folder == null) this.showMessageBox('No folder to create a note')
|
||||
|
||||
return {
|
||||
storage,
|
||||
@@ -67,6 +68,14 @@ class NewNoteButton extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
showMessageBox (message) {
|
||||
dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||
type: 'warning',
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
const { config, style } = this.props
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user