perf: 关闭策略

pull/192/head
xiaojunnuo 3 years ago
parent ca863da878
commit ae06bcfc5f

@ -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) {

@ -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) {

@ -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 })
},

@ -35,7 +35,7 @@
<a-form-item label="远程配置地址" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input v-model="config.app.remoteConfig.url"></a-input>
</a-form-item>
<a-form-item label="关闭策略" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item v-if="!isLinux()" label="关闭策略" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-radio-group v-model="config.app.closeStrategy"
default-value="0" button-style="solid">
<a-radio-button :value="0">

Loading…
Cancel
Save