updating the theme name ui element only if actually applying the theme (not when previewing) looks like a possible solution to #1737

This commit is contained in:
Jack 2021-08-27 13:15:37 +01:00
parent f297978c69
commit fee74f54ab

View file

@ -106,7 +106,6 @@ export function apply(themeName, isPreview = false) {
// $("#currentTheme").attr("href", `themes/${name}.css`);
loadStyle(name).then(() => {
ThemeColors.update();
$(".current-theme .text").text(themeName.replace("_", " "));
if (themeName === "custom") {
colorVars.forEach((e, index) => {
document.documentElement.style.setProperty(
@ -125,6 +124,7 @@ export function apply(themeName, isPreview = false) {
}
if (!isPreview) {
ThemeColors.get().then((colors) => {
$(".current-theme .text").text(themeName.replace("_", " "));
$(".keymap-key").attr("style", "");
ChartController.updateAllChartColors();
updateFavicon(128, 32);