mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Merge branch 'develop' into feature/ons/fix_badge_color
This commit is contained in:
commit
b88ec407a3
2 changed files with 6 additions and 5 deletions
|
@ -8,8 +8,8 @@ Improvements 🙌:
|
|||
- Open an existing DM instead of creating a new one (#2319)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Fix issue when updating the avatar of a room
|
||||
- Exclude yourself when decorating rooms which are direct or don't have more than 2 users (#2370)
|
||||
- Fix issue when restoring draft after sharing (#2287)
|
||||
- Fix issue when updating the avatar of a room (new avatar vanishing)
|
||||
- Discard change dialog displayed by mistake when avatar has been updated
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
getUnreadState()
|
||||
observeSyncState()
|
||||
observeEventDisplayedActions()
|
||||
getDraftIfAny()
|
||||
loadDraftIfAny()
|
||||
observeUnreadState()
|
||||
observeMyRoomMember()
|
||||
observeActiveRoomWidgets()
|
||||
|
@ -495,8 +495,8 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun getDraftIfAny() {
|
||||
val currentDraft = room.getDraft() ?: return
|
||||
private fun loadDraftIfAny() {
|
||||
val currentDraft = room.getDraft()
|
||||
setState {
|
||||
copy(
|
||||
// Create a sendMode from a draft and retrieve the TimelineEvent
|
||||
|
@ -517,6 +517,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
SendMode.EDIT(timelineEvent, currentDraft.text)
|
||||
}
|
||||
}
|
||||
else -> null
|
||||
} ?: SendMode.REGULAR("", fromSharing = false)
|
||||
)
|
||||
}
|
||||
|
@ -772,7 +773,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
private fun popDraft() = withState {
|
||||
if (it.sendMode is SendMode.REGULAR && it.sendMode.fromSharing) {
|
||||
// If we were sharing, we want to get back our last value from draft
|
||||
getDraftIfAny()
|
||||
loadDraftIfAny()
|
||||
} else {
|
||||
// Otherwise we clear the composer and remove the draft from db
|
||||
setState { copy(sendMode = SendMode.REGULAR("", false)) }
|
||||
|
|
Loading…
Reference in a new issue