mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-07 23:26:59 +08:00
fixed randomise theme not working
This commit is contained in:
parent
036dce5ac4
commit
95f9351451
1 changed files with 13 additions and 6 deletions
|
@ -1145,13 +1145,20 @@ function setTheme(name, nosave) {
|
|||
|
||||
let randomTheme = null;
|
||||
function randomiseTheme() {
|
||||
var randomList = Misc.getThemesList().map((t) => {
|
||||
return t.name;
|
||||
// var randomList = Misc.getThemesList().map((t) => {
|
||||
// return t.name;
|
||||
// });
|
||||
var randomList;
|
||||
Misc.getThemesList().then((themes) => {
|
||||
randomList = themes.map((t) => {
|
||||
return t.name;
|
||||
});
|
||||
|
||||
if (config.randomTheme === "fav" && config.favThemes.length > 0)
|
||||
randomList = config.favThemes;
|
||||
randomTheme = randomList[Math.floor(Math.random() * randomList.length)];
|
||||
setTheme(randomTheme, true);
|
||||
});
|
||||
if (config.randomTheme === "fav" && config.favThemes.length > 0)
|
||||
randomList = config.favThemes;
|
||||
randomTheme = randomList[Math.floor(Math.random() * randomList.length)];
|
||||
setTheme(randomTheme, true);
|
||||
}
|
||||
|
||||
function setRandomTheme(val, nosave) {
|
||||
|
|
Loading…
Add table
Reference in a new issue