reduction of the frequency of displaying the notification about the theme change

This commit is contained in:
Mariusz Gumienny 2021-03-30 11:15:26 +02:00
parent 46e78f2764
commit ff3ed3cb58

View file

@ -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);
}
});
}