Skip to content

Commit

Permalink
Keep the current message formatting when switching between composer m…
Browse files Browse the repository at this point in the history
…ode (Regular, Reply, etc.)
  • Loading branch information
bmarty committed Jan 31, 2024
1 parent 423b921 commit 6a30a2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
}

override fun onTextChanged(text: CharSequence) {
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(text))
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(composer.formattedText ?: text))
}

override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class MessageComposerViewModel @AssistedInject constructor(

private fun handleOnTextChanged(action: MessageComposerAction.OnTextChanged) {
val needsSendButtonVisibilityUpdate = currentComposerText.isBlank() != action.text.isBlank()
currentComposerText = SpannableString(action.text)
currentComposerText = action.text
if (needsSendButtonVisibilityUpdate) {
updateIsSendButtonVisibility(true)
}
Expand Down

0 comments on commit 6a30a2e

Please sign in to comment.