MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / disconnectRemoteWorkspace

Function disconnectRemoteWorkspace

apps/desktop/src/main/index.ts:1409–1437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1407}
1408
1409async 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
1439function inheritWindowWorkspaceSession(source: BrowserWindow, target: BrowserWindow): void {
1440 const vault = windowVaults.vaultForWindow(source.id)

Callers 2

registerIpcFunction · 0.70
SettingsModalFunction · 0.50

Calls 7

loadConfigFunction · 0.90
updateConfigFunction · 0.90
currentIpcWindowFunction · 0.85
setVaultForWindowFunction · 0.85
setVaultFunction · 0.85
clearWindowMethod · 0.80
hasRemoteWindowsMethod · 0.80

Tested by

no test coverage detected