(settings)
| 72 | // the latest state, so the request that fires carries the newest values. |
| 73 | let _obsPushTimer = null; |
| 74 | export function pushObsSettingsToServer(settings) { |
| 75 | clearTimeout(_obsPushTimer); |
| 76 | let snapshot; |
| 77 | try { snapshot = JSON.parse(JSON.stringify(settings || {})); } catch { return; } |
| 78 | _obsPushTimer = setTimeout(() => { |
| 79 | fetch('/api/config', { |
| 80 | method: 'POST', |
| 81 | headers: { 'Content-Type': 'application/json' }, |
| 82 | body: JSON.stringify({ [OBS_CONFIG_KEY]: { version: SETTINGS_VERSION, settings: snapshot } }), |
| 83 | }).catch(() => { /* offline — localStorage still holds the change locally */ }); |
| 84 | }, 800); |
| 85 | } |
| 86 | |
| 87 | export const PRESETS = { |
| 88 | foundation: {}, |
no outgoing calls
no test coverage detected