diff --git a/vector/src/main/java/im/vector/app/core/utils/DataSource.kt b/vector/src/main/java/im/vector/app/core/utils/DataSource.kt index 32c1cf9424..ff55b05689 100644 --- a/vector/src/main/java/im/vector/app/core/utils/DataSource.kt +++ b/vector/src/main/java/im/vector/app/core/utils/DataSource.kt @@ -26,7 +26,7 @@ interface DataSource { interface MutableDataSource : DataSource { - suspend fun set(value: T) + suspend fun emit(value: T) fun post(value: T) } @@ -45,7 +45,7 @@ open class BehaviorDataSource(private val defaultValue: T? = null) : MutableD return mutableFlow } - override suspend fun set(value: T) { + override suspend fun emit(value: T) { mutableFlow.emit(value) } @@ -65,7 +65,7 @@ open class PublishDataSource : MutableDataSource { return mutableFlow } - override suspend fun set(value: T) { + override suspend fun emit(value: T) { mutableFlow.emit(value) } 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 d0247553aa..fcc4313558 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 @@ -473,13 +473,13 @@ class MessageComposerViewModel @AssistedInject constructor( } is ParsedCommand.UpgradeRoom -> { viewModelScope.launch { - _viewEvents.set( + _viewEvents.emit( MessageComposerViewEvents.ShowRoomUpgradeDialog( parsedCommand.newVersion, room.roomSummary()?.isPublic ?: false ) ) - _viewEvents.set(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand)) + _viewEvents.emit(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand)) popDraft() } }