From f831252e354c94fa47fc1480618b5822e1abd468 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Mon, 23 May 2022 14:09:29 +0200 Subject: [PATCH] Fixes UpgradeRoom command not working --- .../composer/MessageComposerViewModel.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt index eca5c846ca..d0247553aa 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt @@ -472,14 +472,16 @@ class MessageComposerViewModel @AssistedInject constructor( Unit } is ParsedCommand.UpgradeRoom -> { - _viewEvents.post( - MessageComposerViewEvents.ShowRoomUpgradeDialog( - parsedCommand.newVersion, - room.roomSummary()?.isPublic ?: false - ) - ) - _viewEvents.post(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand)) - popDraft() + viewModelScope.launch { + _viewEvents.set( + MessageComposerViewEvents.ShowRoomUpgradeDialog( + parsedCommand.newVersion, + room.roomSummary()?.isPublic ?: false + ) + ) + _viewEvents.set(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand)) + popDraft() + } } } }