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

Function pushPortableConfig

packages/app-core/src/store.ts:961–974  ·  view source on GitHub ↗
(p: Prefs)

Source from the content-addressed store, hash-verified

959const CONFIG_PUSH_DEBOUNCE_MS = 400
960
961function pushPortableConfig(p: Prefs): void {
962 if (!configFileEnabled) return
963 const bridge = typeof window !== 'undefined' ? window.zen : undefined
964 if (!bridge || typeof bridge.setConfig !== 'function') return
965 if (configPushTimer) clearTimeout(configPushTimer)
966 configPushTimer = setTimeout(() => {
967 configPushTimer = null
968 try {
969 void bridge.setConfig(pickPortablePrefs(p as unknown as Record<string, unknown>))
970 } catch {
971 /* ignore */
972 }
973 }, CONFIG_PUSH_DEBOUNCE_MS)
974}
975
976function savePrefs(p: Prefs): void {
977 try {

Callers 1

savePrefsFunction · 0.85

Calls 2

pickPortablePrefsFunction · 0.90
setConfigMethod · 0.80

Tested by

no test coverage detected