Pārlūkot izejas kodu

Fixed breaking syntax error with genRandomId function selection.

Eden Tyler-Moss 5 gadi atpakaļ
vecāks
revīzija
2a5d0b9cc3
2 mainītis faili ar 3 papildinājumiem un 5 dzēšanām
  1. 1 3
      src/api/v1/public/index.js
  2. 2 2
      src/models/realm.js

+ 1 - 3
src/api/v1/public/index.js

@@ -6,9 +6,7 @@ module.exports = ({ config, realm }) => {
   // Retrieve guaranteed random ID.
   // Retrieve guaranteed random ID.
   app.get('/id', (req, res) => {
   app.get('/id', (req, res) => {
     res.contentType = 'text/html';
     res.contentType = 'text/html';
-    res.send(realm.generateClientId(
-      config.genRandomId ? config.genRandomId : undefined
-    ));
+    res.send(realm.generateClientId(config.genRandomId));
   });
   });
 
 
   // Get a list of all peers for a key, enabled by the `allowDiscovery` flag.
   // Get a list of all peers for a key, enabled by the `allowDiscovery` flag.

+ 2 - 2
src/models/realm.js

@@ -48,8 +48,8 @@ class Realm {
     }
     }
 
 
     const genRandomId = _genRandomId && typeof _genRandomId === 'function' ?
     const genRandomId = _genRandomId && typeof _genRandomId === 'function' ?
-      () => _genRandomId :
-      () => originalGenRandomId;
+      _genRandomId :
+      originalGenRandomId;
 
 
     let clientId = genRandomId();
     let clientId = genRandomId();