Only lookup IP addresses when in Chrome debug mode

This commit is contained in:
Scott Kyle 2016-03-16 09:31:41 -07:00
parent 8d73a8e985
commit d96c645415
1 changed files with 5 additions and 2 deletions

View File

@ -62,10 +62,13 @@ public class RealmReactModule extends ReactContextBaseJavaModule {
@Override @Override
public Map<String, Object> getConstants() { public Map<String, Object> getConstants() {
if (!isContextInjected()) { if (isContextInjected()) {
startWebServer(); // No constants are needed if *not* running in Chrome debug mode.
return Collections.EMPTY_MAP;
} }
startWebServer();
List<String> hosts; List<String> hosts;
if (RealmAnalytics.isRunningOnEmulator()) { if (RealmAnalytics.isRunningOnEmulator()) {
hosts = Arrays.asList(new String[]{"localhost"}); hosts = Arrays.asList(new String[]{"localhost"});