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

This commit is contained in:
Wxw-Gu committed 2026-09-15 11:26:06 +08:00
1 parent 67dc45819e
commit 21b2b57d28
6 files changed
+95 -38

No files matched your search

+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 })