Workaround to load realm from ubuntu_server.js
This commit is contained in:
parent
1b0f6c0b21
commit
65d4fb7747
11
lib/index.js
11
lib/index.js
|
@ -18,6 +18,13 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
console.log("outerRealmConstructor: " + typeof outerRealmConstructor);
|
||||||
|
if (typeof outerRealmConstructor !== 'undefined') {
|
||||||
|
var realmConstructor = outerRealmConstructor;
|
||||||
|
module.exports = realmConstructor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof outerRealmConstructor === 'undefined') {
|
||||||
const require_method = require;
|
const require_method = require;
|
||||||
|
|
||||||
// Prevent React Native packager from seeing modules required with this
|
// Prevent React Native packager from seeing modules required with this
|
||||||
|
@ -57,6 +64,9 @@ function getContext() {
|
||||||
return 'chromedebugger';
|
return 'chromedebugger';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// react-native-desktop expects "nodejs" env
|
||||||
|
return 'nodejs';
|
||||||
|
|
||||||
// Otherwise, we must be in a "normal" react native situation.
|
// Otherwise, we must be in a "normal" react native situation.
|
||||||
// In that case, the Realm type should have been injected by the native code.
|
// In that case, the Realm type should have been injected by the native code.
|
||||||
// If it hasn't, the user likely forgot to run link.
|
// If it hasn't, the user likely forgot to run link.
|
||||||
|
@ -120,3 +130,4 @@ if (!realmConstructor) {
|
||||||
require('./extensions')(realmConstructor);
|
require('./extensions')(realmConstructor);
|
||||||
|
|
||||||
module.exports = realmConstructor;
|
module.exports = realmConstructor;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue