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
1 changed files with 2 additions and 1 deletions

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)
)
}