Fix: getGameList returns nothing on first run

This commit is contained in:
Nelson Chan 2023-02-24 21:06:00 +08:00
parent 6235ce6b29
commit 7b8ed01f27

View File

@ -12,7 +12,7 @@ let gameList = null;
* @returns {any[]}
*/
function getGameList() {
if (!gameList) {
if (gameList == null) {
gameList = gameResolver._readGames().games.sort((a, b) => {
if ( a.pretty < b.pretty ) {
return -1;
@ -22,9 +22,8 @@ function getGameList() {
}
return 0;
});
} else {
return gameList;
}
return gameList;
}
module.exports.generalSocketHandler = (socket, server) => {