mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 04:50:08 +03:00
Fix edit being stuck
This commit is contained in:
parent
a2c75e7c71
commit
0855806ae2
3 changed files with 10 additions and 12 deletions
|
@ -289,7 +289,8 @@ dependencies {
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation "androidx.fragment:fragment:$fragment_version"
|
implementation "androidx.fragment:fragment:$fragment_version"
|
||||||
implementation "androidx.fragment:fragment-ktx:$fragment_version"
|
implementation "androidx.fragment:fragment-ktx:$fragment_version"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta7'
|
// Keep at 2.0.0-beta4 at the moment, as updating is breaking some UI
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
||||||
implementation 'androidx.core:core-ktx:1.3.0'
|
implementation 'androidx.core:core-ktx:1.3.0'
|
||||||
|
|
||||||
implementation "org.threeten:threetenbp:1.4.0:no-tzdb"
|
implementation "org.threeten:threetenbp:1.4.0:no-tzdb"
|
||||||
|
|
|
@ -636,7 +636,7 @@ class RoomDetailFragment @Inject constructor(
|
||||||
val document = parser.parse(messageContent.formattedBody ?: messageContent.body)
|
val document = parser.parse(messageContent.formattedBody ?: messageContent.body)
|
||||||
formattedBody = eventHtmlRenderer.render(document)
|
formattedBody = eventHtmlRenderer.render(document)
|
||||||
}
|
}
|
||||||
composerLayout.composerRelatedMessageContent.text = formattedBody ?: nonFormattedBody
|
composerLayout.composerRelatedMessageContent.text = (formattedBody ?: nonFormattedBody)
|
||||||
|
|
||||||
updateComposerText(defaultContent)
|
updateComposerText(defaultContent)
|
||||||
|
|
||||||
|
|
|
@ -846,17 +846,14 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleExitSpecialMode(action: RoomDetailAction.ExitSpecialMode) {
|
private fun handleExitSpecialMode(action: RoomDetailAction.ExitSpecialMode) = withState {
|
||||||
setState { copy(sendMode = SendMode.REGULAR(action.text)) }
|
if (it.sendMode is SendMode.EDIT) {
|
||||||
withState { state ->
|
room.deleteDraft(NoOpMatrixCallback())
|
||||||
// For edit, just delete the current draft
|
} else {
|
||||||
if (state.sendMode is SendMode.EDIT) {
|
// Save a new draft and keep the previously entered text
|
||||||
room.deleteDraft(NoOpMatrixCallback())
|
room.saveDraft(UserDraft.REGULAR(action.text), NoOpMatrixCallback())
|
||||||
} else {
|
|
||||||
// Save a new draft and keep the previously entered text
|
|
||||||
room.saveDraft(UserDraft.REGULAR(action.text), NoOpMatrixCallback())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
setState { copy(sendMode = SendMode.REGULAR(action.text)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleOpenOrDownloadFile(action: RoomDetailAction.DownloadOrOpen) {
|
private fun handleOpenOrDownloadFile(action: RoomDetailAction.DownloadOrOpen) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue