make isNodeInitialized instance variable

re-init jail on Android
This commit is contained in:
Roman Volosovskyi 2017-01-20 18:25:17 +02:00
parent e47314bb7e
commit 19e3be5109
2 changed files with 7 additions and 5 deletions

View File

@ -19,7 +19,7 @@ public class StatusService extends Service {
private static final String TAG = "StatusService";
private static boolean isNodeInitialized = false;
private boolean isNodeInitialized = false;
private final Handler handler = new Handler();
private ExecutorService executor = null;
@ -341,7 +341,7 @@ public class StatusService extends Service {
}
public static boolean isNodeInitialized() {
public boolean isNodeInitialized() {
return isNodeInitialized;
}

View File

@ -408,8 +408,10 @@
(u/side-effect!
(fn [_ [_ error]]
(.log js/console error)
(let [message (.-message error)]
(when (or (re-find (re-pattern "Could not connect to the server.") message)
(re-find (re-pattern "Failed to connect") message))
(let [message (.-message error)
ios-error? (re-find (re-pattern "Could not connect to the server.") message)
android-error? (re-find (re-pattern "Failed to connect") message)]
(when (or ios-error? android-error?)
(when android-error? (status/init-jail))
(status/restart-rpc)
(dispatch [:load-commands!]))))))