fix(settings): 下载目录授权不再覆盖 data-dir.txt(数据库目录显示/打开错位)

This commit is contained in:
qiqi committed 2026-11-17 08:57:37 +08:00
1 parent ada8916fd6
commit 857acd30d3
3 files changed
+11 -7

No files matched your search

+1 -1
View File
@@ -621,7 +621,7 @@
try {
const rawDl = global.localStorage.getItem('iwb.downloadDir')
const dl = rawDl ? JSON.parse(rawDl) : ''
if (dl) { try { await core().invoke('grant_dir', { dir: String(dl) }) } catch (e) { /* 忽略 */ } }
if (dl) { try { await core().invoke('grant_dir', { dir: String(dl), record: false }) } catch (e) { /* 忽略 */ } }
} catch (e) { /* 下载目录指针不存在或格式异常 */ }
return true
}
+2 -1
View File
@@ -100,7 +100,8 @@
} catch (e) { setNote('切换失败:' + String((e && e.message) || e)) }
}
const openData = async () => {
try { const p = await D.openDataDir(); if (p) setDataDir(p) } catch (e) { setNote('打开失败:' + String((e && e.message) || e)) }
// 只负责打开;界面上的路径始终以 F.dir()(真实资料目录)为准,避免被返回值覆盖
try { await D.openDataDir() } catch (e) { setNote('打开失败:' + String((e && e.message) || e)) }
}
const migrateData = async () => {
try {