()
| 1407 | } |
| 1408 | |
| 1409 | async function disconnectRemoteWorkspace(): Promise<VaultInfo | null> { |
| 1410 | const cfg = await loadConfig() |
| 1411 | const win = currentIpcWindow() ?? mainWindow |
| 1412 | currentWorkspaceMode = 'local' |
| 1413 | |
| 1414 | if (cfg.vaultRoot) { |
| 1415 | if (win && !win.isDestroyed()) { |
| 1416 | return await setVaultForWindow(win, cfg.vaultRoot) |
| 1417 | } |
| 1418 | return await setVault(cfg.vaultRoot) |
| 1419 | } |
| 1420 | |
| 1421 | if (win && !win.isDestroyed()) { |
| 1422 | windowVaults.clearWindow(win.id) |
| 1423 | } |
| 1424 | if (!windowVaults.hasRemoteWindows()) { |
| 1425 | remoteWorkspaceClient = null |
| 1426 | remoteWorkspaceConfig = null |
| 1427 | currentRemoteWorkspaceProfileId = null |
| 1428 | remoteServerCapabilities = null |
| 1429 | } |
| 1430 | currentVault = null |
| 1431 | await updateConfig((current) => ({ |
| 1432 | ...current, |
| 1433 | workspaceMode: 'local', |
| 1434 | remoteWorkspaceProfileId: null |
| 1435 | })) |
| 1436 | return null |
| 1437 | } |
| 1438 | |
| 1439 | function inheritWindowWorkspaceSession(source: BrowserWindow, target: BrowserWindow): void { |
| 1440 | const vault = windowVaults.vaultForWindow(source.id) |
no test coverage detected