Skip to content

Commit 28cd0c6

Browse files
committed
throw error if client doesnt support groups
1 parent be8a3d8 commit 28cd0c6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

example/src/main/java/org/xmtp/android/example/MainViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class MainViewModel : ViewModel() {
7777
val stream: StateFlow<MainListItem?> =
7878
stateFlow(viewModelScope, null) { subscriptionCount ->
7979
if (ClientManager.clientState.value is ClientManager.ClientState.Ready) {
80-
ClientManager.client.conversations.stream()
80+
ClientManager.client.conversations.streamAll()
8181
.flowWhileShared(
8282
subscriptionCount,
8383
SharingStarted.WhileSubscribed(1000L)

library/src/main/java/org/xmtp/android/library/Conversations.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ data class Conversations(
511511
}
512512
}
513513
val stream = libXMTPConversations?.stream(groupCallback)
514-
awaitClose { stream?.end() }
514+
?: throw XMTPException("Client does not support Groups")
515+
awaitClose { stream.end() }
515516
}
516517

517518
/**

0 commit comments

Comments
 (0)