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

Function readStoredFlags

packages/shared/src/contexts/SettingsContext.tsx:217–231  ·  view source on GitHub ↗
(userId?: string)

Source from the content-addressed store, hash-verified

215};
216
217const readStoredFlags = (userId?: string): Partial<SettingsFlags> => {
218 const stored = parseStoredFlags(
219 storageWrapper.getItem(clientOnlyFlagsKey(userId)),
220 );
221
222 if (stored || !userId) {
223 return stored ?? {};
224 }
225
226 // First load since the store became per-account: this user reads the
227 // device-wide entry until `adoptLegacyStoredFlags` moves it across.
228 return (
229 parseStoredFlags(storageWrapper.getItem(legacyClientOnlyFlagsKey)) ?? {}
230 );
231};
232
233const isClientOnlyFlag = (flag: string): boolean =>
234 clientOnlySettingsFlags.includes(flag as ClientOnlyFlagKey);

Callers 3

writeStoredFlagsFunction · 0.85
dropGraduatedStoredFlagsFunction · 0.85
SettingsContextProviderFunction · 0.85

Calls 2

parseStoredFlagsFunction · 0.85
clientOnlyFlagsKeyFunction · 0.85

Tested by

no test coverage detected