mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 06:01:28 +08:00
reduction of the frequency of displaying the notification about the theme change
This commit is contained in:
parent
46e78f2764
commit
ff3ed3cb58
1 changed files with 7 additions and 1 deletions
|
|
@ -134,9 +134,15 @@ export function randomiseTheme() {
|
|||
|
||||
if (Config.randomTheme === "fav" && Config.favThemes.length > 0)
|
||||
randomList = Config.favThemes;
|
||||
|
||||
const previousTheme = randomTheme;
|
||||
randomTheme = randomList[Math.floor(Math.random() * randomList.length)];
|
||||
|
||||
preview(randomTheme);
|
||||
Notifications.add(randomTheme.replace(/_/g, " "), 0);
|
||||
|
||||
if (previousTheme != randomTheme) {
|
||||
Notifications.add(randomTheme.replace(/_/g, " "), 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue