Fix draft bug

Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
This commit is contained in:
Dominic Fischer 2020-11-08 14:57:15 +00:00
parent 62ca9a2a84
commit dee6f35888

View file

@ -496,7 +496,7 @@ class RoomDetailViewModel @AssistedInject constructor(
}
private fun loadDraftIfAny() {
val currentDraft = room.getDraft() ?: return
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)
)
}