From a03ade631f80c5b48223fef7cc269968183b34a7 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 19 Nov 2019 20:46:44 -0800 Subject: [PATCH] UI: Fix Twitch panels not using dark first time When the panels start up for the very first time, the dark theme is not used due to the local storage variable not being set by the first panel. When the program is restarted, it'll be dark from then on out because it's set by the secondary panels rather than the primary panel. This modifies it so that the locale storage variable is properly set by the primary panel. --- UI/auth-twitch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/auth-twitch.cpp b/UI/auth-twitch.cpp index 3cd8b79a6..ce46c60d4 100644 --- a/UI/auth-twitch.cpp +++ b/UI/auth-twitch.cpp @@ -216,7 +216,8 @@ void TwitchAuth::LoadUI() chat->SetWidget(browser); cef->add_force_popup_url(moderation_tools_url, chat.data()); - script = bttv_script; + script = "localStorage.setItem('twilight.theme', 1);"; + script += bttv_script; script += ffz_script; browser->setStartupScript(script);