diff --git a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java index 42c4f08d..07ebfeb8 100644 --- a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java +++ b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java @@ -58,13 +58,12 @@ public class RealmReactModule extends ReactContextBaseJavaModule { if (!isContextInjected()) { startWebServer(); } - startWebServer(); return Collections.EMPTY_MAP; } @Override public void onCatalystInstanceDestroy() { - clearFlag(); + clearContextInjectedFlag(); stopWebServer(); } @@ -133,7 +132,7 @@ public class RealmReactModule extends ReactContextBaseJavaModule { private native boolean isContextInjected(); // clear the flag set when injecting Realm API - private native void clearFlag(); + private native void clearContextInjectedFlag(); // fileDir: path of the internal storage of the application private native void setDefaultRealmFileDirectory(String fileDir); diff --git a/src/android/io_realm_react_RealmReactModule.cpp b/src/android/io_realm_react_RealmReactModule.cpp index 999058a5..dd4d0696 100644 --- a/src/android/io_realm_react_RealmReactModule.cpp +++ b/src/android/io_realm_react_RealmReactModule.cpp @@ -50,13 +50,12 @@ JNIEXPORT jstring JNICALL Java_io_realm_react_RealmReactModule_processChromeDebu JNIEXPORT jboolean JNICALL Java_io_realm_react_RealmReactModule_isContextInjected (JNIEnv *env, jclass) - { - return realmContextInjected; - } +{ + return realmContextInjected; +} -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearFlag +JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearContextInjectedFlag (JNIEnv *env, jclass) - { - realmContextInjected = false;//might not be needed - - } \ No newline at end of file +{ + realmContextInjected = false; +} diff --git a/src/android/io_realm_react_RealmReactModule.h b/src/android/io_realm_react_RealmReactModule.h index a33c7b5e..fb6404ee 100644 --- a/src/android/io_realm_react_RealmReactModule.h +++ b/src/android/io_realm_react_RealmReactModule.h @@ -38,9 +38,9 @@ JNIEXPORT jboolean JNICALL Java_io_realm_react_RealmReactModule_isContextInjecte /* * Class: io_realm_react_RealmReactModule - * Method: clearFlag + * Method: clearContextInjectedFlag */ -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearFlag +JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearContextInjectedFlag (JNIEnv *, jclass);