Skip to content

Commit 1227dcd

Browse files
authored
1. Replace first with firstOrNull to avoid exception
2. Bring back `streamVideo.logOut()` which clears device token storage from local
1 parent a46c001 commit 1227dcd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

demo-app/src/main/kotlin/io/getstream/video/android/ui/join/CallJoinViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import kotlinx.coroutines.flow.SharingStarted
4040
import kotlinx.coroutines.flow.collectLatest
4141
import kotlinx.coroutines.flow.filterNotNull
4242
import kotlinx.coroutines.flow.first
43+
import kotlinx.coroutines.flow.firstOrNull
4344
import kotlinx.coroutines.flow.flatMapLatest
4445
import kotlinx.coroutines.flow.flowOf
4546
import kotlinx.coroutines.flow.shareIn
@@ -141,9 +142,10 @@ class CallJoinViewModel @Inject constructor(
141142
googleSignInClient.signOut()
142143

143144
StreamVideo.instanceOrNull()?.let { streamVideo ->
144-
streamVideo.getDevice().first()?.let { device ->
145+
streamVideo.getDevice().firstOrNull()?.let { device ->
145146
streamVideo.deleteDevice(device)
146147
}
148+
streamVideo.logOut()
147149
}
148150

149151
StreamVideo.removeClient()

0 commit comments

Comments
 (0)