1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Change to use sdialog.showMEssageBox() instead of window.alert

This commit is contained in:
asmsuechan
2017-08-14 11:39:06 +09:00
parent 9d20fd91ec
commit a752730718

View File

@@ -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 (