diff --git a/src/datastore/index.js b/src/datastore/index.js index 3104e6e..7e3ce8b 100644 --- a/src/datastore/index.js +++ b/src/datastore/index.js @@ -2,11 +2,18 @@ import Datastore from 'lowdb' import LodashId from 'lodash-id' import FileSync from 'lowdb/adapters/FileSync' import path from 'path' +import fs from 'fs-extra' import { remote, app } from 'electron' const APP = process.type === 'renderer' ? remote.app : app const STORE_PATH = APP.getPath('userData') +if (process.type !== 'renderer') { + if (!fs.pathExistsSync(STORE_PATH)) { + fs.mkdirpSync(STORE_PATH) + } +} + const adapter = new FileSync(path.join(STORE_PATH, '/data.json')) const db = Datastore(adapter) diff --git a/src/main/index.js b/src/main/index.js index b371e24..09e183d 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -23,7 +23,7 @@ const settingWinURL = process.env.NODE_ENV === 'development' : `file://${__dirname}/index.html#setting/upload` function createTray () { - tray = new Tray(`${__static}/menubarDefaultTemplate.png`) + tray = new Tray(`${__static}/menubar.png`) const contextMenu = Menu.buildFromTemplate([ { role: 'quit', @@ -111,7 +111,7 @@ function createTray () { } window.webContents.send('dragFiles', imgs) }) - toggleWindow() + // toggleWindow() } const createWindow = () => { @@ -146,7 +146,7 @@ const createSettingWindow = () => { settingWindow = new BrowserWindow({ height: 450, width: 800, - show: true, + show: false, frame: true, center: true, fullscreenable: false, diff --git a/static/menubar.png b/static/menubar.png new file mode 100644 index 0000000..175af7d Binary files /dev/null and b/static/menubar.png differ diff --git a/static/menubarDefaultTemplate.png b/static/menubarDefaultTemplate.png deleted file mode 100644 index 4aab91e..0000000 Binary files a/static/menubarDefaultTemplate.png and /dev/null differ