From e5c7ab517f809d489b5623e5bc06174e6efe7c65 Mon Sep 17 00:00:00 2001 From: Eden Tyler-Moss Date: Wed, 23 Oct 2019 03:26:47 +0100 Subject: [PATCH] Fixed bug where using the original randomId function would break. --- src/models/realm.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/realm.js b/src/models/realm.js index e0355fd..e9221ce 100644 --- a/src/models/realm.js +++ b/src/models/realm.js @@ -43,9 +43,13 @@ class Realm { } generateClientId (_randomId) { + const originalRandomId = () => { + return (Math.random().toString(36) + '0000000000000000000').substr(2, 16); + } + const randomId = typeof _randomId === 'function' ? () => _randomId : - () => (Math.random().toString(36) + '0000000000000000000').substr(2, 16); + () => originalRandomId; let clientId = randomId(randomId)();