Commit 32239224 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Fix again mistaken refactoring.

parent 72430ee3
......@@ -29,8 +29,8 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView,
val avatarUrl = UrlHelper.getAvatarUrl(serverUrl, myself.username!!)
view.showProfile(
avatarUrl,
myself.name!!,
myself.username!!,
myself.name ?: "",
myself.username ?: "",
myself.emails?.get(0)?.address!!
)
} catch (exception: RocketChatException) {
......
......@@ -50,7 +50,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
override fun showProfile(avatarUrl: String, name: String, username: String, email: String) {
image_avatar.setImageURI(avatarUrl)
text_username.textContent = name
text_name.textContent = name
text_username.textContent = username
text_email.textContent = email
......@@ -124,13 +124,13 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
private fun listenToChanges() {
Observables.combineLatest(text_username.asObservable(), text_username.asObservable(), text_email.asObservable()).subscribe({ t ->
if (t.first.toString() != currentName || t.second.toString() != currentUsername || t.third.toString() != currentEmail) {
startActionMode()
} else {
finishActionMode()
}
})
Observables.combineLatest(text_name.asObservable(), text_username.asObservable(), text_email.asObservable()).subscribe({ t ->
if (t.first.toString() != currentName || t.second.toString() != currentUsername || t.third.toString() != currentEmail) {
startActionMode()
} else {
finishActionMode()
}
})
}
private fun startActionMode() {
......
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