Skip to content

Commit 9432a20

Browse files
committed
Fix duplicate music players when switching to geocities
1 parent 1ad93e1 commit 9432a20

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/scripts/theme.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ buttons.forEach((btn) => {
150150
currentTheme = theme ?? DEFAULT_THEME;
151151
localStorage.setItem("theme", theme);
152152
// Geocities applies inline styles everywhere, reload to clean up
153-
if (wasGeocities && theme !== "geocities") {
153+
// Also reload if switching TO geocities while standalone music player is active
154+
if (
155+
(wasGeocities && theme !== "geocities") ||
156+
(theme === "geocities" && musicPlayerActive)
157+
) {
154158
location.reload();
155159
return;
156160
}

0 commit comments

Comments
 (0)