From 1c80395b5a70983f9ca466780f8fb38a98b2bda0 Mon Sep 17 00:00:00 2001 From: Janis Date: Mon, 31 Oct 2022 18:30:22 +0100 Subject: [PATCH] localstorage theme --- js/pubsub.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/pubsub.js b/js/pubsub.js index e6e3561..b56fa5f 100644 --- a/js/pubsub.js +++ b/js/pubsub.js @@ -3,6 +3,7 @@ let ws; let channelId; function changeColorTheme(theme) { + localStorage.setItem("theme", JSON.stringify(theme)); rootElem.style.setProperty("--border-color-1", theme[0]); rootElem.style.setProperty("--border-color-2", theme[1]); } @@ -104,4 +105,4 @@ function pubSubMain() { } pubSubMain(); -// changeColorTheme(CONFIG.themes.purple); +changeColorTheme(JSON.parse(localStorage.getItem("theme")));