fix: S1 安全冲刺——切库清空标签页+冲刷(FR-V6)、重命名/移动同步标签页路径(FR-T7)、默认库路径设置页(FR-V5);vaultBrowse IPC+pickDirectory;tab-store closeAll/renamePath;store resetEditor/syncCurrentPath;safety E2E 2 项
This commit is contained in:
@@ -39,6 +39,13 @@ export class VaultService {
|
||||
return this.switch(result.filePaths[0]);
|
||||
}
|
||||
|
||||
// 仅浏览选择目录路径,不切换(FR-V5 设置页浏览按钮)
|
||||
async pickDirectory(): Promise<string | null> {
|
||||
const result = await dialog.showOpenDialog({ properties: ['openDirectory'] });
|
||||
if (result.canceled || result.filePaths.length === 0) return null;
|
||||
return result.filePaths[0];
|
||||
}
|
||||
|
||||
async switch(root: string): Promise<VaultMeta> {
|
||||
// 校验是存在的目录
|
||||
const stat = await fs.stat(root).catch(() => null);
|
||||
|
||||
Reference in New Issue
Block a user