Updated previewTheme to set a variable

a variable is set whenever this function is called, so we can query the variable if the system is previewing a theme
This commit is contained in:
willerbee 2020-10-14 13:52:46 +08:00 committed by GitHub
parent 41c487458e
commit 7999d460de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -882,7 +882,7 @@ function setIndicateTypos(it, nosave) {
}
function previewTheme(name) {
function previewTheme(name, setIsPreviewingVar = true) {
if (
(testActive || resultVisible) &&
(config.theme === "nausea" || config.theme === "round_round_baby")
@ -890,6 +890,7 @@ function previewTheme(name) {
return;
if (resultVisible && (name === "nausea" || name === "round_round_baby"))
return;
isPreviewingTheme = setIsPreviewingVar;
$("#currentTheme").attr("href", `themes/${name}.css`);
setTimeout(() => {
refreshThemeColorObject();