Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit e59be27

Browse files
committed
theme
1 parent 1e29922 commit e59be27

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencode/src/cli/cmd/tui/context/theme.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
288288

289289
createEffect(() => {
290290
const theme = sync.data.config.theme
291-
console.log("theme", theme)
292291
if (theme) setStore("active", theme)
293292
})
294293

295-
createEffect(() => {
294+
function init() {
295+
resolveSystemTheme()
296296
getCustomThemes()
297297
.then((custom) => {
298298
setStore(
@@ -309,7 +309,9 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
309309
setStore("ready", true)
310310
}
311311
})
312-
})
312+
}
313+
314+
onMount(init)
313315

314316
function resolveSystemTheme() {
315317
console.log("resolveSystemTheme")
@@ -318,6 +320,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
318320
size: 16,
319321
})
320322
.then((colors) => {
323+
console.log(colors.palette)
321324
if (!colors.palette[0]) {
322325
if (store.active === "system") {
323326
setStore(
@@ -341,11 +344,9 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
341344
}
342345

343346
const renderer = useRenderer()
344-
resolveSystemTheme()
345-
346-
process.on("SIGUSR2", () => {
347+
process.on("SIGUSR2", async () => {
347348
renderer.clearPaletteCache()
348-
resolveSystemTheme()
349+
init()
349350
})
350351

351352
const values = createMemo(() => {

0 commit comments

Comments
 (0)