(userId?: string)
| 215 | }; |
| 216 | |
| 217 | const 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 | |
| 233 | const isClientOnlyFlag = (flag: string): boolean => |
| 234 | clientOnlySettingsFlags.includes(flag as ClientOnlyFlagKey); |
no test coverage detected