From d96c645415bc6b48903c1fc396a75f88c983e369 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Wed, 16 Mar 2016 09:31:41 -0700 Subject: [PATCH] Only lookup IP addresses when in Chrome debug mode --- .../src/main/java/io/realm/react/RealmReactModule.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 b304fdb6..4d337213 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 @@ -62,10 +62,13 @@ public class RealmReactModule extends ReactContextBaseJavaModule { @Override public Map getConstants() { - if (!isContextInjected()) { - startWebServer(); + if (isContextInjected()) { + // No constants are needed if *not* running in Chrome debug mode. + return Collections.EMPTY_MAP; } + startWebServer(); + List hosts; if (RealmAnalytics.isRunningOnEmulator()) { hosts = Arrays.asList(new String[]{"localhost"});