From 1b1155f6c0a7a6f50b0757897ecb38d02f56adca Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Thu, 2 Apr 2020 21:05:04 +0200
Subject: [PATCH] make (user) themes persist trough page reloads

---
 src/gui/theming.js           | 7 +++++++
 src/uncategorized/options.tw | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gui/theming.js b/src/gui/theming.js
index ac274203c91..fa248354326 100644
--- a/src/gui/theming.js
+++ b/src/gui/theming.js
@@ -5,6 +5,13 @@ App.UI.Theme = (function() {
 	let currentThemeElement = null;
 	let devTheme = null;
 
+	// reload theme on page reload
+	$(document).on(":passagestart", () => {
+		if (currentThemeElement === null && V.theme !== 0) {
+			load(V.theme);
+		}
+	});
+
 	return {
 		selector: selector,
 		devTheme: reloadDevTheme,
diff --git a/src/uncategorized/options.tw b/src/uncategorized/options.tw
index 27e7fb9e308..b6437eac4e9 100644
--- a/src/uncategorized/options.tw
+++ b/src/uncategorized/options.tw
@@ -1057,7 +1057,7 @@ This save was created using FC version $ver build $releaseID.
 	</div>
 
 	<p>
-		UI theme selector. Allows to select a single CSS file to be loaded. <span class="red">The file has to be located in the same directory as the HTML file otherwise it will simply not load at all.</span> <span class="yellow">Themes do not persist through page reloads.</span>
+		UI theme selector. Allows to select a single CSS file to be loaded. <span class="red">The file has to be located in the same directory as the HTML file otherwise it will simply not load at all.</span>
 		<<print App.UI.DOM.includeDOM(App.UI.Theme.selector(), "themeSelector")>>
 	</p>
 
-- 
GitLab