mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
make configurable --disable-direct-write flag
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ const nodeIpc = require('@rokt33r/node-ipc')
|
||||
const GhReleases = require('electron-gh-releases')
|
||||
// electron.crashReporter.start()
|
||||
|
||||
require('./config')
|
||||
var mainWindow = null
|
||||
var finderProcess = null
|
||||
var finderWindow = null
|
||||
@@ -295,7 +296,6 @@ app.on('ready', function () {
|
||||
})
|
||||
|
||||
require('./hotkey')
|
||||
require('./config')
|
||||
})
|
||||
|
||||
module.exports = app
|
||||
|
||||
Reference in New Issue
Block a user