From bbe62c361b41571064db8fcc7dc6fc1d52b6090a Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Tue, 18 Jul 2017 11:28:33 +0300 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20execute=20callback=20in=20Realm?= =?UTF-8?q?.open=20either?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/extensions.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/extensions.js b/lib/extensions.js index 44dfd780..6d08f1df 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -48,13 +48,14 @@ module.exports = function(realmConstructor) { if (error) { reject(error); } - - try { - let syncedRealm = new this(config); - //FIXME: RN hangs here. Remove when node's makeCallback alternative is implemented - setTimeout(() => { resolve(syncedRealm); }, 1); - } catch (e) { - reject(e); + else { + try { + let syncedRealm = new this(config); + //FIXME: RN hangs here. Remove when node's makeCallback alternative is implemented + setTimeout(() => { resolve(syncedRealm); }, 1); + } catch (e) { + reject(e); + } } }); });