mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-18 03:26:07 +08:00
Merge pull request #1155 from 0x8b/theme-controller-notification
reduction of the frequency of displaying the notification about the t…
This commit is contained in:
commit
4d8bd8e8f1
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