diff --git a/currentVersion.md b/currentVersion.md index aba59240..a772679b 100644 --- a/currentVersion.md +++ b/currentVersion.md @@ -24,6 +24,7 @@ - Windows 便携模式,无需安装运行,数据存储在程序目录下的 `data` 文件夹中,且支持自动更新 - Linux 新增 `rpm` 安装包 - 新增图床编辑卡片页面,解决多配置切换时的混乱问题 +- 优化了图床独立处理设置的配置保存逻辑 - 文件浏览页面新增列表模式支持。 - 现在第一次启动时根据系统语言自动选择界面语言 - 现在windows系统第一次启动时会默认显示主界面 @@ -53,6 +54,7 @@ ### 🐛 问题修复 +- 修复了图片预处理设置中,单图床设置时变量值没有及时更新的问题 - 修复了管理页面中排序下拉框显示异常的问题 - 修复了管理页面图床列表未正确高亮当前选中项的问题 - 修复了管理页面markdown预览内容没有正确渲染的问题 diff --git a/currentVersion_en.md b/currentVersion_en.md index f96f1e14..6e4b1777 100644 --- a/currentVersion_en.md +++ b/currentVersion_en.md @@ -25,6 +25,7 @@ Use custom `javascript` scripts to extend PicList's functionality without the ne - Added `rpm` installation package for Linux. - Added image hosting editing card page to resolve confusion when switching multiple configurations. - Added list mode support to the file browsing page. +- Optimized the configuration saving logic for independent image hosting processing settings. - Now automatically selects the interface language based on the system language on the first launch. - Now the main interface will be displayed by default on the first launch of Windows systems. - Now supports manually disabling GPU acceleration to resolve black screen or flickering issues caused by some hardware compatibility. @@ -53,6 +54,7 @@ Use custom `javascript` scripts to extend PicList's functionality without the ne ### 🐛 Bug Fixes +- Fixed the issue in the image preprocessing settings where variable values were not updated in a timely manner when setting a single image hosting. - Fixed the issue where the sort dropdown box on the management page displayed abnormally. - Fixed the issue where the image hosting list on the management page did not correctly highlight the currently selected item. - Fixed the issue where the markdown preview content on the management page did not render correctly. diff --git a/src/renderer/components/ImageProcessSetting.vue b/src/renderer/components/ImageProcessSetting.vue index ab6b96ea..c3cb1cc3 100644 --- a/src/renderer/components/ImageProcessSetting.vue +++ b/src/renderer/components/ImageProcessSetting.vue @@ -1402,6 +1402,11 @@ function safeSetMapValue(form: any, fieldName: string, picbedType: string, value if (!form[mapFieldName]) { form[mapFieldName] = {} } + const globalValue = form[fieldName] + const isSameValue = + fieldName === 'formatConvertObj' + ? JSON.stringify(JSON.parse(value)) === JSON.stringify(JSON.parse(globalValue || '{}')) + : value === globalValue const isValueDefault = fieldName === 'formatConvertObj' ? JSON.stringify(JSON.parse(value)) === JSON.stringify(defaultValue) @@ -1410,7 +1415,7 @@ function safeSetMapValue(form: any, fieldName: string, picbedType: string, value fieldName === 'formatConvertObj' ? JSON.stringify(form[fieldName]) === JSON.stringify(defaultValue) : form[fieldName] === defaultValue - if (isValueDefault && isFormValueDefault) { + if ((isValueDefault && isFormValueDefault) || isSameValue) { delete form[mapFieldName][picbedType] } else { if (fieldName === 'formatConvertObj') { diff --git a/src/renderer/components/PerPicbedSetting.vue b/src/renderer/components/PerPicbedSetting.vue index 380bb7e3..9f4ac808 100644 --- a/src/renderer/components/PerPicbedSetting.vue +++ b/src/renderer/components/PerPicbedSetting.vue @@ -23,16 +23,16 @@
{ })) }) -function getMapValue(mapObj: Record | undefined, picbedType: string, defaultValue: any) { - if (!mapObj) return defaultValue - const rawMapObj = getRawData(mapObj) - const value = - rawMapObj[picbedType] !== undefined ? rawMapObj[picbedType] : globalValue !== undefined ? globalValue : defaultValue - return typeof value === 'object' ? JSON.stringify(getRawData(value)) : value -} +const currentValuesMap = computed(() => { + if (!mapField) return {} + + const result: Record = {} + for (const picbed of availablePicbeds.value) { + const type = picbed.type + const val = mapField[type] !== undefined ? mapField[type] : globalValue !== undefined ? globalValue : defaultValue + + result[type] = typeof val === 'object' ? JSON.stringify(getRawData(val)) : val + } + return result +}) function handleMapChange(picbedType: string, value: any, id?: string) { if (id) { diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue index 4cf9bf4a..ea72c848 100644 --- a/src/renderer/pages/PicGoSetting.vue +++ b/src/renderer/pages/PicGoSetting.vue @@ -905,6 +905,7 @@