fix possible hang on iOS

This commit is contained in:
blagoev 2017-09-08 19:56:08 +03:00
parent 43d8f2967f
commit 0214dff951
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ module.exports = function(realmConstructor) {
},
(error) => {
if (error) {
reject(error);
setTimeout(() => { reject(error); }, 1);
}
else {
try {
@ -91,7 +91,7 @@ module.exports = function(realmConstructor) {
},
(error) => {
if (error) {
callback(error);
setTimeout(() => { callback(error); }, 1);
}
else {
try {

View File

@ -86,7 +86,7 @@ function getSpecialPurposeRealm(user, realmName, schema) {
setTimeout(() => {}, 1);
if (error) {
reject(error);
setTimeout(() => reject(error), 1);
}
else {
try {
@ -95,7 +95,7 @@ function getSpecialPurposeRealm(user, realmName, schema) {
//FIXME: RN hangs here. Remove when node's makeCallback alternative is implemented (#1255)
setTimeout(() => resolve(syncedRealm), 1);
} catch (e) {
reject(e);
setTimeout(() => reject(e), 1);
}
}
});