Commit e387dbcf authored by Yusuke Iwaki's avatar Yusuke Iwaki

fix "Authenticationg..." back press process.

parent ac6b09ce
......@@ -163,10 +163,10 @@ public class ServerConfigActivity extends AbstractFragmentActivity {
}
@Override protected void onBackPresseNotHandled() {
if (ServerConfig.hasActiveConnection()) {
super.onBackPresseNotHandled();
} else {
if (ServerConfig.hasLoginRequiredConnection()) {
moveTaskToBack(true);
} else {
super.onBackPresseNotHandled();
}
}
}
......@@ -30,9 +30,10 @@ public class ServerConfig extends RealmObject {
return realm.where(ServerConfig.class).isNotNull("token");
}
public static boolean hasActiveConnection() {
public static boolean hasLoginRequiredConnection() {
ServerConfig config =
RealmHelper.executeTransactionForRead(realm -> queryActiveConnections(realm).findFirst());
RealmHelper.executeTransactionForRead(realm ->
queryLoginRequiredConnections(realm).findFirst());
return config != null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment