Don’t invoke openAsync callback twice

This commit is contained in:
Nikola Irinchev 2017-07-18 00:16:25 +03:00
parent 22a086859f
commit bd10a6d8e0
No known key found for this signature in database
GPG Key ID: 8A8A59EF2C23B465

View File

@ -65,13 +65,14 @@ module.exports = function(realmConstructor) {
if (error) {
callback(error);
}
try {
let syncedRealm = new this(config);
//FIXME: RN hangs here. Remove when node's makeCallback alternative is implemented
setTimeout(() => { callback(null, syncedRealm); }, 1);
} catch (e) {
callback(e);
else {
try {
let syncedRealm = new this(config);
//FIXME: RN hangs here. Remove when node's makeCallback alternative is implemented
setTimeout(() => { callback(null, syncedRealm); }, 1);
} catch (e) {
callback(e);
}
}
});
},