allowing chart color update on preview

increased debounce a bit
closes #3841
This commit is contained in:
Miodec 2023-01-04 19:35:41 +01:00
parent 8ca71f0320
commit 1e6d15a002

View file

@ -165,14 +165,14 @@ function apply(themeName: string, isCustom: boolean, isPreview = false): void {
}
AnalyticsController.log("changedTheme", { theme: themeName });
if (!isPreview) {
ThemeColors.getAll().then((colors) => {
$(".keymapKey").attr("style", "");
ChartController.updateAllChartColors();
updateFavicon(128, 32);
$("#metaThemeColor").attr("content", colors.bg);
});
}
// if (!isPreview) {
ThemeColors.getAll().then((colors) => {
$(".keymapKey").attr("style", "");
ChartController.updateAllChartColors();
updateFavicon(128, 32);
$("#metaThemeColor").attr("content", colors.bg);
});
// }
$(".current-theme .text").text(
isCustom ? "custom" : themeName.replace(/_/g, " ")
);
@ -188,7 +188,7 @@ export function preview(
}
const debouncedPreview = debounce(
100,
250,
(themeIdenfitier, isCustom, randomTheme) => {
isPreviewingTheme = true;
apply(themeIdenfitier, isCustom, !randomTheme);