Keep the current message formatting when switching between composer mode (Regular, Reply, etc.)

This commit is contained in:
Benoit Marty 2024-01-31 18:18:36 +01:00 committed by Benoit Marty
parent 423b9215c4
commit 6a30a2ed32
2 changed files with 2 additions and 2 deletions

View File

@ -404,7 +404,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
} }
override fun onTextChanged(text: CharSequence) { override fun onTextChanged(text: CharSequence) {
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(text)) messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(composer.formattedText ?: text))
} }
override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state -> override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state ->

View File

@ -151,7 +151,7 @@ class MessageComposerViewModel @AssistedInject constructor(
private fun handleOnTextChanged(action: MessageComposerAction.OnTextChanged) { private fun handleOnTextChanged(action: MessageComposerAction.OnTextChanged) {
val needsSendButtonVisibilityUpdate = currentComposerText.isBlank() != action.text.isBlank() val needsSendButtonVisibilityUpdate = currentComposerText.isBlank() != action.text.isBlank()
currentComposerText = SpannableString(action.text) currentComposerText = action.text
if (needsSendButtonVisibilityUpdate) { if (needsSendButtonVisibilityUpdate) {
updateIsSendButtonVisibility(true) updateIsSendButtonVisibility(true)
} }