Explorar o código

Fixed bug where using the original randomId function would break.

Eden Tyler-Moss %!s(int64=5) %!d(string=hai) anos
pai
achega
e5c7ab517f
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/models/realm.js

+ 5 - 1
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)();