feat: 隐藏设置里的防撤回入口,历史开启强制收敛为 false

This commit is contained in:
Wxw-Gu
2026-09-15 11:26:06 +08:00
parent 67dc45819e
commit 21b2b57d28
6 changed files with 95 additions and 38 deletions
+9 -1
View File
@@ -174,6 +174,12 @@ export function loadSettings(): AppSettings {
if (cache.dbRoot) {
cache.dbRoot = redirectLegacyWeChatFilesToXwechat(cache.dbRoot)
}
// 防撤回已下线(设置入口已隐藏):历史版本可能把它持久化为 true。
// 这里强制收敛为 false 并回写磁盘,确保旧的撤回监听与撤回日志不会继续运行。
if (cache.recallProtectionEnabled) {
cache.recallProtectionEnabled = false
saveSettings(cache)
}
return cache
}
} catch (error) {
@@ -184,7 +190,9 @@ export function loadSettings(): AppSettings {
}
export function saveSettings(next: AppSettings): AppSettings {
cache = { ...next }
// 防撤回已下线:所有写入路径(含 settings:set 补丁)统一收敛为 false,
// 避免遗留入口或旧版本把它重新打开。
cache = { ...next, recallProtectionEnabled: false }
try {
ensureDir()
fs.writeJsonSync(SETTINGS_FILE, cache, { spaces: 2 })
@@ -35,7 +35,8 @@ export const SETTINGS_NAVIGATION: SettingsNavigationGroup[] = [
{
label: '应用',
items: [
{ id: 'recall-protection', label: '防撤回' },
// “防撤回”已下线,不再在设置里暴露;保留 category/render case 以兼容已有页面状态。
// { id: 'recall-protection', label: '防撤回' },
{ id: 'appearance', label: '外观与行为' },
{ id: 'advanced', label: '高级' },
{ id: 'about', label: '关于' }
@@ -48,5 +49,6 @@ export const SETTINGS_CATEGORY_LABELS = {
SETTINGS_NAVIGATION.flatMap((group) => group.items.map((item) => [item.id, item.label]))
),
'personal-wechat-send': '微信发送',
'storage-export': '存储与导出'
'storage-export': '存储与导出',
'recall-protection': '防撤回'
} as Record<SettingsCategoryId, string>