MCPcopy
hub / github.com/wavetermdev/waveterm / getConfigBackgroundAtom

Function getConfigBackgroundAtom

frontend/app/store/global.ts:238–249  ·  view source on GitHub ↗
(bgKey: string | null)

Source from the content-addressed store, hash-verified

236const configBackgroundAtomCache = new Map<string, Atom<BackgroundConfigType>>();
237
238function 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
251function getSettingsPrefixAtom(prefix: string): Atom<SettingsType> {
252 if (isPreviewWindow()) return NullAtom as Atom<SettingsType>;

Callers

nothing calls this directly

Calls 3

isPreviewWindowFunction · 0.90
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected