mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
allowing chart color update on preview
increased debounce a bit closes #3841
This commit is contained in:
parent
8ca71f0320
commit
1e6d15a002
1 changed files with 9 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue