From 2a5d0b9cc3a9729b21e61e8ad88f5e2f7cc60123 Mon Sep 17 00:00:00 2001 From: Eden Tyler-Moss Date: Fri, 31 Jan 2020 10:34:35 +0000 Subject: [PATCH] Fixed breaking syntax error with genRandomId function selection. --- src/api/v1/public/index.js | 4 +--- src/models/realm.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api/v1/public/index.js b/src/api/v1/public/index.js index ba49de9..f500aa1 100644 --- a/src/api/v1/public/index.js +++ b/src/api/v1/public/index.js @@ -6,9 +6,7 @@ module.exports = ({ config, realm }) => { // Retrieve guaranteed random ID. app.get('/id', (req, res) => { 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. diff --git a/src/models/realm.js b/src/models/realm.js index cd84ea3..73af397 100644 --- a/src/models/realm.js +++ b/src/models/realm.js @@ -48,8 +48,8 @@ class Realm { } const genRandomId = _genRandomId && typeof _genRandomId === 'function' ? - () => _genRandomId : - () => originalGenRandomId; + _genRandomId : + originalGenRandomId; let clientId = genRandomId();