MCPcopy Create free account
hub / github.com/dailydotdev/apps / getPatchyConfig

Function getPatchyConfig

packages/shared/src/features/patchy/patchyConfig.ts:245–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243// previous load, else the defaults. A freshly fetched config is cached for
244// the next load instead of swapping art and timing mid-session.
245export const getPatchyConfig = (): PatchyConfig => {
246 if (typeof window === 'undefined') {
247 return defaultPatchyConfig;
248 }
249 if (!loadedConfig) {
250 let cached: Partial<PatchyConfigResponse> | null = null;
251 try {
252 cached = JSON.parse(
253 storageWrapper.getItem(PATCHY_CONFIG_STORAGE_KEY) ?? 'null',
254 );
255 } catch {
256 cached = null;
257 }
258 loadedConfig = toPatchyConfig(cached);
259 }
260 return loadedConfig;
261};

Callers 5

usePatchyAssistantFunction · 0.90
FaceImageFunction · 0.90
PatchyOfferFunction · 0.90
PatchyPanelHeaderFunction · 0.90
usePatchyCompanionFunction · 0.90

Calls 1

toPatchyConfigFunction · 0.85

Tested by

no test coverage detected