mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 07:14:04 +00:00
Merge pull request #2835 from chakflying/fix/game-list-empty
Fix: getGameList returns nothing on first run
This commit is contained in:
commit
c4a9374671
1 changed files with 3 additions and 4 deletions
|
@ -9,10 +9,10 @@ let gameList = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a game list via GameDig
|
* Get a game list via GameDig
|
||||||
* @returns {any[]}
|
* @returns {Object[]} list of games supported by GameDig
|
||||||
*/
|
*/
|
||||||
function getGameList() {
|
function getGameList() {
|
||||||
if (!gameList) {
|
if (gameList == null) {
|
||||||
gameList = gameResolver._readGames().games.sort((a, b) => {
|
gameList = gameResolver._readGames().games.sort((a, b) => {
|
||||||
if ( a.pretty < b.pretty ) {
|
if ( a.pretty < b.pretty ) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -22,9 +22,8 @@ function getGameList() {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
return gameList;
|
|
||||||
}
|
}
|
||||||
|
return gameList;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.generalSocketHandler = (socket, server) => {
|
module.exports.generalSocketHandler = (socket, server) => {
|
||||||
|
|
Loading…
Reference in a new issue