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

Fix the issue of message box not being cleared after sending the message #2146

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ class ChatRoomPresenter @Inject constructor(
RoomUiModel(roles = chatRoles, isBroadcast = chatIsBroadcast)
), false
)
view.clearMessageComposition(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing that, if something went wrong when calling the client.sendMessage(...) will cause the users lost their messages, needing it to be written again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the unsent message will still be displayed (greyed out) so the user won't lose the message. Am I wrong?

client.sendMessage(id, chatRoomId, text)
messagesRepository.save(newMessage.copy(synced = true))
logMessageSent()
Expand All @@ -376,7 +377,6 @@ class ChatRoomPresenter @Inject constructor(
Timber.e(ex, "Error sending message...")
jobSchedulerInteractor.scheduleSendingMessages()
} finally {
view.clearMessageComposition(true)
view.enableSendMessageButton()
}
}
Expand Down