site, omarchy: a reload shows the theme the page showed, not one magpie told before the desktop turned (owner: 在 Omarchy 下网页的确可以自动识别 Omarchy 主题切换事件了,但是一刷新又变回了默认的 Omarchy 主题) — with magpie not answering (here the VM had restarted and nothing served 127.0.0.1:3425), the page follows Omarchy only by light/dark: rose-pine set turned it to catppuccin-latte, but localStorage still held miasma, the theme magpie had last told, and a reload painted that. Now when the desktop turns to the other mode while magpie isn't answering, that stale theme is forgotten, so a reload paints what the page showed. Tried in the Omarchy VM in Chromium 152 on a copy of the owner's own profile (its loopback-network grant and storage), omarchy.js served from this change: magpie down, miasma → rose-pine turned the page to catppuccin-latte and a reload kept catppuccin-latte (it went back to miasma before); magpie up, rose-pine came through live and a reload kept rose-pine.

This commit is contained in:
yetone committed 2026-10-05 02:24:44 +08:00
1 parent b45b410b0c
commit 558abd13ea
1 file changed
+3
+3
View File
@@ -246,6 +246,9 @@
light.addEventListener("change", () => {
if (!cur || st.pick || status === "live") return;
const live = st.live && st.live.mode === scheme() && fromMagpie(st.live);
// the theme magpie last told is off the desktop now: a reload shows
// what this shows, not that one
if (!live && st.live) { delete st.live; save(); }
paint(live || builtin(GUESS[scheme()]));
});
for (const name of ["loopback-network", "local-network-access"]) {