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

Escape from addition a note when the note is in the trashbox

This commit is contained in:
asmsuechan
2017-07-07 19:31:03 +09:00
parent cbff5fb585
commit ae08bf4d7a

View File

@@ -9,6 +9,9 @@ import ee from 'browser/main/lib/eventEmitter'
import ConfigManager from 'browser/main/lib/ConfigManager'
import dataApi from 'browser/main/lib/dataApi'
const { remote } = require('electron')
const { dialog } = remote
const OSX = window.process.platform === 'darwin'
class TopBar extends React.Component {
@@ -41,7 +44,17 @@ class TopBar extends React.Component {
}
handleNewPostButtonClick (e) {
let { config } = this.props
let { config, location } = this.props
if (location.pathname === '/trashed') {
dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'warning',
message: 'Cannot create new note',
detail: 'You cannot create new note in trash box.',
buttons: ['OK']
})
return
}
switch (config.ui.defaultNote) {
case 'MARKDOWN_NOTE':