mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +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'
|
const snippetFile = process.env.NODE_ENV === 'production'
|
||||||
? path.join(app.getPath('appData'), 'Boostnote', 'snippets.json')
|
? 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 () {
|
function getAppData () {
|
||||||
return process.env.APPDATA || (process.platform === 'darwin'
|
return process.env.APPDATA || (process.platform === 'darwin'
|
||||||
? process.env.HOME + 'Library/Preferences'
|
? process.env.HOME + 'Library/Preferences'
|
||||||
: '/.config')
|
: require('os').homedir() + '/.config')
|
||||||
}
|
}
|
||||||
|
|
||||||
const consts = {
|
const consts = {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class SnippetTab extends React.Component {
|
|||||||
handleSnippetContextMenu (snippet) {
|
handleSnippetContextMenu (snippet) {
|
||||||
const menu = new Menu()
|
const menu = new Menu()
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: 'Delete',
|
label: i18n.__('Delete snippet'),
|
||||||
click: () => {
|
click: () => {
|
||||||
this.deleteSnippet(snippet.id)
|
this.deleteSnippet(snippet.id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user