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:
Jack 2021-03-30 16:42:09 +01:00 committed by GitHub
commit 4d8bd8e8f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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