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

Function getPatchyConfig

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

Source from the content-addressed store, hash-verified

279// previous load, else the defaults. A freshly fetched config is cached for
280// the next load instead of swapping art and timing mid-session.
281export const getPatchyConfig = (): PatchyConfig => {
282 if (typeof window === 'undefined') {
283 return defaultPatchyConfig;
284 }
285 if (!loadedConfig) {
286 let cached: Partial<PatchyConfigResponse> | null = null;
287 try {
288 cached = JSON.parse(
289 storageWrapper.getItem(PATCHY_CONFIG_STORAGE_KEY) ?? 'null',
290 );
291 } catch {
292 cached = null;
293 }
294 loadedConfig = toPatchyConfig(cached);
295 }
296 return loadedConfig;
297};
298
299// Whether a face animates is read off the image the config gives it, so a
300// config that points a face back at a still image gets the circle's motion

Callers 9

renderPatchyButtonFunction · 0.90
usePatchyAssistantFunction · 0.90
FaceImageFunction · 0.90
PatchyOfferFunction · 0.90
PatchyPanelHeaderFunction · 0.90
PatchyPanelFunction · 0.90
usePatchyCompanionFunction · 0.90
isPatchyFaceAnimatedFunction · 0.85

Calls 1

toPatchyConfigFunction · 0.85

Tested by

no test coverage detected