(p: Prefs)
| 959 | const CONFIG_PUSH_DEBOUNCE_MS = 400 |
| 960 | |
| 961 | function 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 | |
| 976 | function savePrefs(p: Prefs): void { |
| 977 | try { |
no test coverage detected