From 21d3942d2b0237f7abbdcc787cb2890d03c32c52 Mon Sep 17 00:00:00 2001 From: PiEgg Date: Sun, 12 Jul 2020 22:01:00 +0800 Subject: [PATCH] :bug: Fix: choose default picBed failure ISSUES CLOSED: #537 --- src/main/apis/app/system/index.ts | 3 ++- src/renderer/components/ChoosePicBed.vue | 3 ++- src/renderer/pages/MiniPage.vue | 3 ++- src/renderer/pages/Plugin.vue | 3 ++- src/renderer/pages/Upload.vue | 3 ++- src/renderer/pages/picbeds/Others.vue | 3 ++- src/renderer/utils/ConfirmButtonMixin.ts | 3 ++- src/universal/datastore/index.ts | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/apis/app/system/index.ts b/src/main/apis/app/system/index.ts index c80f8845e..5642022d3 100644 --- a/src/main/apis/app/system/index.ts +++ b/src/main/apis/app/system/index.ts @@ -28,7 +28,8 @@ export function createContextMenu () { checked: db.get('picBed.current') === item.type, click () { picgo.saveConfig({ - 'picBed.current': item.type + 'picBed.current': item.type, + 'picBed.uploader': item.type }) if (windowManager.has(IWindowList.SETTING_WINDOW)) { windowManager.get(IWindowList.SETTING_WINDOW)!.webContents.send('syncPicBed') diff --git a/src/renderer/components/ChoosePicBed.vue b/src/renderer/components/ChoosePicBed.vue index 72d1fb0b5..860c59177 100644 --- a/src/renderer/components/ChoosePicBed.vue +++ b/src/renderer/components/ChoosePicBed.vue @@ -28,7 +28,8 @@ export default { methods: { choosePicBed (val) { this.letPicGoSaveData({ - 'picBed.current': this.type + 'picBed.current': this.type, + 'picBed.uploader': this.type }) this.$emit('update:choosed', this.type) } diff --git a/src/renderer/pages/MiniPage.vue b/src/renderer/pages/MiniPage.vue index bbe37dc2e..ee3f7bebe 100644 --- a/src/renderer/pages/MiniPage.vue +++ b/src/renderer/pages/MiniPage.vue @@ -145,7 +145,8 @@ export default class extends Vue { checked: this.$db.get('picBed.current') === item.type, click () { _this.letPicGoSaveData({ - 'picBed.current': item.type + 'picBed.current': item.type, + 'picBed.uploader': item.type }) ipcRenderer.send('syncPicBed') } diff --git a/src/renderer/pages/Plugin.vue b/src/renderer/pages/Plugin.vue index c30a033f5..9ab7c777d 100644 --- a/src/renderer/pages/Plugin.vue +++ b/src/renderer/pages/Plugin.vue @@ -433,7 +433,8 @@ export default class extends Vue { const current = this.$db.get('picBed.current') if (current === name) { this.letPicGoSaveData({ - 'picBed.current': 'smms' + 'picBed.current': 'smms', + 'picBed.uploader': 'smms' }) } } diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue index fca3fcaeb..13dd3cdbe 100644 --- a/src/renderer/pages/Upload.vue +++ b/src/renderer/pages/Upload.vue @@ -222,7 +222,8 @@ export default class extends Vue { checked: this.$db.get('picBed.current') === item.type, click () { _this.letPicGoSaveData({ - 'picBed.current': item.type + 'picBed.current': item.type, + 'picBed.uploader': item.type }) ipcRenderer.send('syncPicBed') } diff --git a/src/renderer/pages/picbeds/Others.vue b/src/renderer/pages/picbeds/Others.vue index 1fb3983b6..a88da31db 100644 --- a/src/renderer/pages/picbeds/Others.vue +++ b/src/renderer/pages/picbeds/Others.vue @@ -69,7 +69,8 @@ export default class extends Vue { } setDefaultPicBed (type: string) { this.letPicGoSaveData({ - 'picBed.current': type + 'picBed.current': type, + 'picBed.uploader': type }) // @ts-ignore 来自mixin的数据 this.defaultPicBed = type diff --git a/src/renderer/utils/ConfirmButtonMixin.ts b/src/renderer/utils/ConfirmButtonMixin.ts index 98e1fc68c..4e777c0ed 100644 --- a/src/renderer/utils/ConfirmButtonMixin.ts +++ b/src/renderer/utils/ConfirmButtonMixin.ts @@ -5,7 +5,8 @@ export default class extends Vue { defaultPicBed = this.$db.get('picBed.current') setDefaultPicBed (type: string) { this.letPicGoSaveData({ - 'picBed.current': type + 'picBed.current': type, + 'picBed.uploader': type }) this.defaultPicBed = type const successNotification = new Notification('设置默认图床', { diff --git a/src/universal/datastore/index.ts b/src/universal/datastore/index.ts index 4ba6cdd2c..2c1f0399d 100644 --- a/src/universal/datastore/index.ts +++ b/src/universal/datastore/index.ts @@ -29,7 +29,7 @@ class DB { if (!this.db.has('picBed').value()) { this.db.set('picBed', { - current: 'smms', + current: 'smms', // deprecated uploader: 'smms', smms: { token: ''