1
0
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:
Hung Nguyen
2018-04-21 09:40:32 +07:00
parent ddcd722598
commit a7b85b123e
2 changed files with 3 additions and 3 deletions

View File

@@ -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 = {

View File

@@ -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)
}