MCPcopy Create free account
hub / github.com/anomalyco/opencode / onMedia

Function onMedia

packages/ui/src/theme/context.tsx:256–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254
255 const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)")
256 const onMedia = () => {
257 if (store.colorScheme !== "system") return
258 setStore("mode", getSystemMode())
259 }
260 makeEventListener(mediaQuery, "change", onMedia)
261
262 const rawTheme = read(STORAGE_KEYS.THEME_ID)

Callers

nothing calls this directly

Calls 2

setStoreFunction · 0.85
getSystemModeFunction · 0.85

Tested by

no test coverage detected