Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 120dfd0

Browse files
committed
Fix a bug that makes the typing status being send multiples time over the socket.
1 parent b537e47 commit 120dfd0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
312312
showToolbarChatRoomIcon(chatRoomType)
313313
}
314314
getDraftMessage()
315+
subscribeComposeTextMessage()
315316

316317
analyticsManager.logScreenView(ScreenViewEvent.ChatRoom)
317318
}
@@ -848,7 +849,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
848849
true
849850
)
850851

851-
subscribeComposeTextMessage()
852852
emojiKeyboardPopup = EmojiKeyboardPopup(activity!!, activity!!.findViewById(R.id.fragment_container))
853853

854854
emojiKeyboardPopup.listener = this
@@ -1000,12 +1000,12 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
10001000
}
10011001

10021002
private fun subscribeComposeTextMessage() {
1003-
val editTextObservable = text_message.asObservable()
1004-
1005-
compositeDisposable.addAll(
1006-
subscribeComposeButtons(editTextObservable),
1007-
subscribeComposeTypingStatus(editTextObservable)
1008-
)
1003+
text_message.asObservable().let {
1004+
compositeDisposable.addAll(
1005+
subscribeComposeButtons(it),
1006+
subscribeComposeTypingStatus(it)
1007+
)
1008+
}
10091009
}
10101010

10111011
private fun unsubscribeComposeTextMessage() {

0 commit comments

Comments
 (0)