mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 14:54:33 +00:00
fix Realm.open to use the correct ctor function
This commit is contained in:
parent
ef63a8829c
commit
22987f0a8f
@ -44,7 +44,7 @@ module.exports = function(realmConstructor) {
|
|||||||
Object.defineProperties(realmConstructor, getOwnPropertyDescriptors({
|
Object.defineProperties(realmConstructor, getOwnPropertyDescriptors({
|
||||||
open(config) {
|
open(config) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const realm = new Realm(config);
|
const realm = new realmConstructor(config);
|
||||||
realm.wait((error) => {
|
realm.wait((error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error"));
|
reject(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error"));
|
||||||
@ -56,7 +56,7 @@ module.exports = function(realmConstructor) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
openAsync(config, callback) {
|
openAsync(config, callback) {
|
||||||
const realm = new Realm(config);
|
const realm = new realmConstructor(config);
|
||||||
realm.wait((error) => {
|
realm.wait((error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
callback(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error"));
|
callback(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user