diff --git a/src/renderer/components/ConfigForm.vue b/src/renderer/components/ConfigForm.vue index cc34afbd0..9b5bc5552 100644 --- a/src/renderer/components/ConfigForm.vue +++ b/src/renderer/components/ConfigForm.vue @@ -21,7 +21,7 @@ :placeholder="item.message || item.name" > @@ -33,7 +33,7 @@ > (this.getConfigType()) if (val.length > 0) { - this.configList = cloneDeep(val).map((item: any) => { + this.configList = cloneDeep(val).map((item) => { let defaultValue = item.default !== undefined ? item.default : item.type === 'checkbox' ? [] : null if (item.type === 'checkbox') { - const defaults = item.choices.filter((i: any) => { + const defaults = item.choices?.filter((i: any) => { return i.checked - }).map((i: any) => i.value) + }).map((i: any) => i.value) || [] defaultValue = union(defaultValue, defaults) } if (config && config[item.name] !== undefined) { diff --git a/src/renderer/pages/Plugin.vue b/src/renderer/pages/Plugin.vue index c53872c93..398cfeea1 100644 --- a/src/renderer/pages/Plugin.vue +++ b/src/renderer/pages/Plugin.vue @@ -428,10 +428,6 @@ export default class extends Vue { ipcRenderer.send(OPEN_URL, 'https://github.com/PicGo/Awesome-PicGo') } - saveConfig (data: IObj) { - ipcRenderer.send('picgoSaveData', data) - } - handleImportLocalPlugin () { ipcRenderer.send('importLocalPlugin') this.loading = true diff --git a/src/universal/types/types.d.ts b/src/universal/types/types.d.ts index 75e05f21e..5df3f336a 100644 --- a/src/universal/types/types.d.ts +++ b/src/universal/types/types.d.ts @@ -151,6 +151,11 @@ interface IPicGoPluginConfig { type: string required: boolean default?: any + alias?: string + choices?: { + name?: string + value?: any + }[] [propName: string]: any }