Commit 78a69c45 authored by Yusuke Iwaki's avatar Yusuke Iwaki

separate session-changed logic.

parent 2824b15b
......@@ -149,7 +149,11 @@ public class MainActivity extends AbstractAuthedActivity {
.createObjectObserver(realm ->
Session.queryDefaultSession(realm)
.isNotNull(Session.TOKEN))
.setOnUpdateListener(session -> {
.setOnUpdateListener(this::onSessionChanged);
sessionObserver.sub();
}
private void onSessionChanged(@Nullable Session session) {
if (session == null) {
if (isForeground) {
LaunchUtil.showLoginActivity(this, serverConfigId);
......@@ -178,8 +182,6 @@ public class MainActivity extends AbstractAuthedActivity {
} else {
tipViewManager.updateStatus(StatusTicker.STATUS_DISMISS, null);
}
});
sessionObserver.sub();
}
private void updateSidebarMainFragment() {
......
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