Skip to content

Commit

Permalink
feat: clear orphaned events on navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Oct 11, 2023
1 parent 503cccf commit 133b25e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.wire.kalium.logic.feature.asset.GetMessageAssetUseCase
import com.wire.kalium.logic.feature.asset.MessageAssetResult
import com.wire.kalium.logic.feature.asset.UpdateAssetMessageDownloadStatusUseCase
import com.wire.kalium.logic.feature.asset.UpdateDownloadStatusResult
import com.wire.kalium.logic.feature.conversation.ClearUsersTypingEventsUseCase
import com.wire.kalium.logic.feature.conversation.GetConversationUnreadEventsCountUseCase
import com.wire.kalium.logic.feature.conversation.ObserveConversationDetailsUseCase
import com.wire.kalium.logic.feature.message.GetMessageByIdUseCase
Expand Down Expand Up @@ -96,6 +97,9 @@ class ConversationMessagesViewModelArrangement {
@MockK
lateinit var getConversationUnreadEventsCount: GetConversationUnreadEventsCountUseCase

@MockK
lateinit var clearUsersTypingEvents: ClearUsersTypingEventsUseCase

private val viewModel: ConversationMessagesViewModel by lazy {
ConversationMessagesViewModel(
savedStateHandle,
Expand All @@ -109,7 +113,8 @@ class ConversationMessagesViewModelArrangement {
toggleReaction,
resetSession,
conversationAudioMessagePlayer,
getConversationUnreadEventsCount
getConversationUnreadEventsCount,
clearUsersTypingEvents
)
}

Expand All @@ -123,6 +128,7 @@ class ConversationMessagesViewModelArrangement {
coEvery { getMessagesForConversationUseCase(any(), any()) } returns messagesChannel.consumeAsFlow()
coEvery { getConversationUnreadEventsCount(any()) } returns GetConversationUnreadEventsCountUseCase.Result.Success(0L)
coEvery { updateAssetMessageDownloadStatus(any(), any(), any()) } returns UpdateDownloadStatusResult.Success
coEvery { clearUsersTypingEvents() } returns Unit
}

fun withSuccessfulOpenAssetMessage(
Expand Down

0 comments on commit 133b25e

Please sign in to comment.