From 2a0cf4efe9f56a626cd5bdb5c37865b8fda1c5b8 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 11 Dec 2025 09:31:12 -0600 Subject: [PATCH] Turn `#theme` into a proper setter --- app/javascript/controllers/theme_controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/controllers/theme_controller.js b/app/javascript/controllers/theme_controller.js index fbc93a44f..30e296dca 100644 --- a/app/javascript/controllers/theme_controller.js +++ b/app/javascript/controllers/theme_controller.js @@ -8,22 +8,22 @@ export default class extends Controller { } setLight() { - this.#setTheme("light") + this.#theme = "light" } setDark() { - this.#setTheme("dark") + this.#theme = "dark" } setAuto() { - this.#setTheme("auto") + this.#theme = "auto" } get #storedTheme() { return localStorage.getItem("theme") || "auto" } - #setTheme(theme) { + set #theme(theme) { localStorage.setItem("theme", theme) if (theme === "auto") { @@ -36,7 +36,7 @@ export default class extends Controller { } #applyStoredTheme() { - this.#setTheme(this.#storedTheme) + this.#theme = this.#storedTheme } #updateButtons() {