Commit 120dfd0f authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Fix a bug that makes the typing status being send multiples time over the socket.

parent b537e472
...@@ -312,6 +312,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -312,6 +312,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
showToolbarChatRoomIcon(chatRoomType) showToolbarChatRoomIcon(chatRoomType)
} }
getDraftMessage() getDraftMessage()
subscribeComposeTextMessage()
analyticsManager.logScreenView(ScreenViewEvent.ChatRoom) analyticsManager.logScreenView(ScreenViewEvent.ChatRoom)
} }
...@@ -848,7 +849,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -848,7 +849,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
true true
) )
subscribeComposeTextMessage()
emojiKeyboardPopup = EmojiKeyboardPopup(activity!!, activity!!.findViewById(R.id.fragment_container)) emojiKeyboardPopup = EmojiKeyboardPopup(activity!!, activity!!.findViewById(R.id.fragment_container))
emojiKeyboardPopup.listener = this emojiKeyboardPopup.listener = this
...@@ -1000,13 +1000,13 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -1000,13 +1000,13 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
} }
private fun subscribeComposeTextMessage() { private fun subscribeComposeTextMessage() {
val editTextObservable = text_message.asObservable() text_message.asObservable().let {
compositeDisposable.addAll( compositeDisposable.addAll(
subscribeComposeButtons(editTextObservable), subscribeComposeButtons(it),
subscribeComposeTypingStatus(editTextObservable) subscribeComposeTypingStatus(it)
) )
} }
}
private fun unsubscribeComposeTextMessage() { private fun unsubscribeComposeTextMessage() {
compositeDisposable.clear() compositeDisposable.clear()
......
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