(bgKey: string | null)
| 236 | const configBackgroundAtomCache = new Map<string, Atom<BackgroundConfigType>>(); |
| 237 | |
| 238 | function getConfigBackgroundAtom(bgKey: string | null): Atom<BackgroundConfigType> { |
| 239 | if (isPreviewWindow() || bgKey == null) return NullAtom as Atom<BackgroundConfigType>; |
| 240 | let bgAtom = configBackgroundAtomCache.get(bgKey); |
| 241 | if (bgAtom == null) { |
| 242 | bgAtom = atom((get) => { |
| 243 | const fullConfig = get(atoms.fullConfigAtom); |
| 244 | return fullConfig.backgrounds?.[bgKey]; |
| 245 | }); |
| 246 | configBackgroundAtomCache.set(bgKey, bgAtom); |
| 247 | } |
| 248 | return bgAtom; |
| 249 | } |
| 250 | |
| 251 | function getSettingsPrefixAtom(prefix: string): Atom<SettingsType> { |
| 252 | if (isPreviewWindow()) return NullAtom as Atom<SettingsType>; |
nothing calls this directly
no test coverage detected