Fix / disable context menu on not sent messages
This commit is contained in:
parent
220e6224e7
commit
c9240c2dce
|
@ -95,7 +95,7 @@ class MessageActionsViewModel(initialState: MessageActionState) : VectorViewMode
|
|||
messageBody = body,
|
||||
ts = dateFormat.format(Date(originTs ?: 0)),
|
||||
showPreview = body != null,
|
||||
canReact = event.root.type == EventType.MESSAGE,
|
||||
canReact = event.root.type == EventType.MESSAGE && event.sendState.isSent(),
|
||||
senderAvatarPath = parcel.informationData.avatarUrl
|
||||
)
|
||||
} else {
|
||||
|
|
|
@ -54,13 +54,14 @@ class MessageMenuViewModel(initialState: MessageMenuState) : VectorViewModel<Mes
|
|||
?: event.root.content.toModel()
|
||||
val type = messageContent?.type
|
||||
|
||||
if (event.sendState == SendState.UNSENT) {
|
||||
if (!event.sendState.isSent()) {
|
||||
//Resend and Delete
|
||||
return MessageMenuState(
|
||||
//TODO
|
||||
listOf(
|
||||
SimpleAction(ACTION_RESEND, R.string.resend, R.drawable.ic_send, event.root.eventId),
|
||||
//TODO delete icon
|
||||
SimpleAction(ACTION_DELETE, R.string.delete, R.drawable.ic_delete, event.root.eventId)
|
||||
// SimpleAction(ACTION_RESEND, R.string.resend, R.drawable.ic_send, event.root.eventId),
|
||||
// //TODO delete icon
|
||||
// SimpleAction(ACTION_DELETE, R.string.delete, R.drawable.ic_delete, event.root.eventId)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue