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

Function loadConfig

apps/desktop/src/main/vault.ts:530–537  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528 * view of the config — only writes need the stricter contract enforced in
529 * `updateConfig`. */
530export async function loadConfig(): Promise<PersistedConfig> {
531 const result = await loadConfigSafely()
532 if (result.readable) return result.config
533 // Unreadable: callers reading for display can fall back to defaults rather
534 // than crashing. Writes go through `updateConfig`, which uses
535 // `loadConfigSafely` directly and aborts instead of clobbering.
536 return { ...DEFAULT_CONFIG }
537}
538
539function sanitizeForPersist(cfg: PersistedConfig): PersistedConfig {
540 const normalized = normalizePersistedConfig(cfg)

Callers 15

openMarkdownFileFromOSFunction · 0.90
resolveActiveLocalVaultFunction · 0.90
createWindowFunction · 0.90
closeLocalVaultForWindowFunction · 0.90
listLocalVaultsFunction · 0.90

Calls 1

loadConfigSafelyFunction · 0.85

Tested by

no test coverage detected