MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / pushObsSettingsToServer

Function pushObsSettingsToServer

web/observatory/js/hud-controller.js:74–85  ·  view source on GitHub ↗
(settings)

Source from the content-addressed store, hash-verified

72// the latest state, so the request that fires carries the newest values.
73let _obsPushTimer = null;
74export 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
87export const PRESETS = {
88 foundation: {},

Callers 2

saveObsSettingsFunction · 0.85
saveSettingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected