1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

make configurable --disable-direct-write flag

This commit is contained in:
Dick Choi
2016-01-09 21:48:21 +09:00
parent 567f453232
commit 45a46cbc7a
4 changed files with 36 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ const electron = require('electron')
const app = electron.app
const ipc = electron.ipcMain
const jetpack = require('fs-jetpack')
const mainWindow = require('./main-window')
const defaultConfig = {
'editor-font-size': '14',
@@ -41,13 +40,20 @@ function saveConfig () {
// Init
global.config = Object.assign({}, defaultConfig, getConfig())
function applyConfig () {
mainWindow.webContents.send('config-apply')
if (global.config['disable-direct-write']) {
app.commandLine.appendSwitch('disable-direct-write')
}
ipc.on('configUpdated', function (event, newConfig) {
global.config = Object.assign({}, defaultConfig, global.config, newConfig)
saveConfig()
applyConfig()
app.on('ready', function () {
const mainWindow = require('./main-window')
function applyConfig () {
mainWindow.webContents.send('config-apply')
}
ipc.on('configUpdated', function (event, newConfig) {
global.config = Object.assign({}, defaultConfig, global.config, newConfig)
saveConfig()
applyConfig()
})
})