diff --git a/packages/core/src/config.js b/packages/core/src/config.js index 42eeebbf..6a067d6f 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -172,6 +172,10 @@ const configApi = { const config = configApi.get() return config || {} }, + update (partConfig) { + const newConfig = lodash.merge(configApi.get(), partConfig) + configApi.save(newConfig) + }, get, set (newConfig) { if (newConfig == null) { diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index 93481b77..20b48cd7 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -186,6 +186,10 @@ function createWindow (startHideWindow) { return } e.preventDefault() + if (isLinux()) { + quit(app) + return + } const config = DevSidecar.api.config.get() const closeStrategy = config.app.closeStrategy if (closeStrategy === 0) { diff --git a/packages/gui/src/bridge/on-close/front.js b/packages/gui/src/bridge/on-close/front.js index 28bddfc0..789c6f76 100644 --- a/packages/gui/src/bridge/on-close/front.js +++ b/packages/gui/src/bridge/on-close/front.js @@ -33,7 +33,7 @@ function install (app, api) { async onOk () { console.log('OK') if (result.save) { - await api.config.save({ app: { closeStrategy: result.closeType } }) + await api.config.update({ app: { closeStrategy: result.closeType } }) } api.ipc.send('close', { key: 'selected', value: result.closeType }) }, diff --git a/packages/gui/src/view/pages/setting.vue b/packages/gui/src/view/pages/setting.vue index 6ece805a..2222c998 100644 --- a/packages/gui/src/view/pages/setting.vue +++ b/packages/gui/src/view/pages/setting.vue @@ -35,7 +35,7 @@ - +