Skip to content

Commit

Permalink
remove CurrentScreenManager from OngoingCallViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
saleniuk committed May 24, 2024
1 parent 2c74999 commit 7d1de23
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import com.wire.android.appLogger
import com.wire.android.datastore.GlobalDataStore
import com.wire.android.di.CurrentAccount
import com.wire.android.ui.calling.model.UICallParticipant
import com.wire.android.util.CurrentScreen
import com.wire.android.util.CurrentScreenManager
import com.wire.kalium.logic.data.call.Call
import com.wire.kalium.logic.data.call.CallClient
import com.wire.kalium.logic.data.call.VideoState
Expand Down Expand Up @@ -58,7 +56,6 @@ class OngoingCallViewModel @AssistedInject constructor(
private val establishedCalls: ObserveEstablishedCallsUseCase,
private val requestVideoStreams: RequestVideoStreamsUseCase,
private val setVideoSendState: SetVideoSendStateUseCase,
private val currentScreenManager: CurrentScreenManager
) : ViewModel() {
var shouldShowDoubleTapToast: Boolean by mutableStateOf(false)
private set
Expand Down Expand Up @@ -112,10 +109,7 @@ class OngoingCallViewModel @AssistedInject constructor(
.distinctUntilChanged()
.collect { calls ->
val currentCall = calls.find { call -> call.conversationId == conversationId }
val currentScreen =
currentScreenManager.observeCurrentScreen(viewModelScope).first()
val isOnBackground = currentScreen is CurrentScreen.InBackground
if (currentCall == null && isOnBackground) {
if (currentCall == null) {
state = state.copy(flowState = OngoingCallState.FlowState.CallClosed)
}
}
Expand Down

0 comments on commit 7d1de23

Please sign in to comment.