(root: string)
| 1275 | } |
| 1276 | |
| 1277 | async function setVault(root: string): Promise<VaultInfo> { |
| 1278 | const win = currentIpcWindow() ?? mainWindow |
| 1279 | if (win && !win.isDestroyed()) return await setVaultForWindow(win, root) |
| 1280 | |
| 1281 | await ensureVaultLayout(root) |
| 1282 | const vault = vaultInfo(path.resolve(root)) |
| 1283 | currentVault = vault |
| 1284 | currentWorkspaceMode = 'local' |
| 1285 | remoteWorkspaceClient = null |
| 1286 | remoteWorkspaceConfig = null |
| 1287 | currentRemoteWorkspaceProfileId = null |
| 1288 | remoteServerCapabilities = null |
| 1289 | stopRemoteWatch() |
| 1290 | await updateConfig((cfg) => ({ |
| 1291 | ...cfg, |
| 1292 | workspaceMode: 'local', |
| 1293 | vaultRoot: vault.root, |
| 1294 | localVaults: rememberLocalVault(cfg.localVaults, vault), |
| 1295 | remoteWorkspaceProfileId: null |
| 1296 | })) |
| 1297 | return vault |
| 1298 | } |
| 1299 | |
| 1300 | async function closeLocalVaultForWindow(): Promise<VaultInfo | null> { |
| 1301 | const win = currentIpcWindow() ?? mainWindow |
no test coverage detected