Explorar el Código

Technical difficulties, stand by...

Craig Fletcher hace 4 años
padre
commit
7fcb1853e8
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      modules/server.js

+ 4 - 1
modules/server.js

@@ -182,7 +182,10 @@ function lockChoices() {
 server.get("/votes", function(req, res, next) {
   const revealDate = 1618077600 * 1000;
   if (Date.now() >= revealDate) {
-    const choices = db.get("/factionChoices") || lockChoices();
+    let choices = db.get("/factionChoices");
+    if (Object.keys(choices).length < 1) {
+      choices = lockChoices();
+    }
 
     res.send(choices);
   } else {