Commit 214d8bc1 authored by Yusuke Iwaki's avatar Yusuke Iwaki

fix bug that login screen not shown.

parent dd9f79dd
...@@ -3,6 +3,7 @@ package chat.rocket.android.fragment.server_config; ...@@ -3,6 +3,7 @@ package chat.rocket.android.fragment.server_config;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.widget.TextView; import android.widget.TextView;
import chat.rocket.android.R; import chat.rocket.android.R;
import chat.rocket.android.RocketChatCache;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.model.ServerConfig; import chat.rocket.android.model.ServerConfig;
...@@ -38,6 +39,10 @@ public class InputHostnameFragment extends AbstractServerConfigFragment { ...@@ -38,6 +39,10 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
final String hostname = final String hostname =
TextUtils.or(TextUtils.or(editor.getText(), editor.getHint()), "").toString(); TextUtils.or(TextUtils.or(editor.getText(), editor.getHint()), "").toString();
RocketChatCache.get(getContext()).edit()
.putString(RocketChatCache.KEY_SELECTED_SERVER_CONFIG_ID, serverConfigId)
.apply();
RealmStore.getDefault().executeTransaction( RealmStore.getDefault().executeTransaction(
realm -> realm.createOrUpdateObjectFromJson(ServerConfig.class, realm -> realm.createOrUpdateObjectFromJson(ServerConfig.class,
new JSONObject().put("serverConfigId", serverConfigId) new JSONObject().put("serverConfigId", serverConfigId)
......
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