mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
fixed get appdata path error
This commit is contained in:
@@ -14,12 +14,12 @@ themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light
|
||||
|
||||
const snippetFile = process.env.NODE_ENV === 'production'
|
||||
? path.join(app.getPath('appData'), 'Boostnote', 'snippets.json')
|
||||
: require('path').resolve(path.join(getAppData(), 'Boostnote', 'snippets.json'))
|
||||
: path.join(getAppData(), 'Boostnote', 'snippets.json')
|
||||
|
||||
function getAppData () {
|
||||
return process.env.APPDATA || (process.platform === 'darwin'
|
||||
? process.env.HOME + 'Library/Preferences'
|
||||
: '/.config')
|
||||
: require('os').homedir() + '/.config')
|
||||
}
|
||||
|
||||
const consts = {
|
||||
|
||||
@@ -36,7 +36,7 @@ class SnippetTab extends React.Component {
|
||||
handleSnippetContextMenu (snippet) {
|
||||
const menu = new Menu()
|
||||
menu.append(new MenuItem({
|
||||
label: 'Delete',
|
||||
label: i18n.__('Delete snippet'),
|
||||
click: () => {
|
||||
this.deleteSnippet(snippet.id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user