Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PBE-3845] fix side-effect & add missing changelog #5295

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

## stream-chat-android-state
### 🐞 Fixed
- Fixed member.role being missing when updating other members' roles in a channel. [#5290](https://github.com/GetStream/stream-chat-android/pull/5290)

### ⬆️ Improved

Expand Down Expand Up @@ -70,6 +71,7 @@
- Extended search result list styling. [#5286](https://github.com/GetStream/stream-chat-android/pull/5286)

### ✅ Added
- Added additional message option for user blocking. [#5289](https://github.com/GetStream/stream-chat-android/pull/5289)

### ⚠️ Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ internal class ChannelStateLogic(
replaceWith = ReplaceWith("updateChannelData((ChannelData?) -> ChannelData?)"),
)
fun updateChannelData(channel: Channel) {
val currentOwnCapabilities = mutableState.channelData.value.ownCapabilities
val newChannelData = channel.toChannelData().copy(ownCapabilities = currentOwnCapabilities)
val newChannelData = channel.toChannelData().let {
when (it.ownCapabilities.isEmpty()) {
true -> it.copy(ownCapabilities = mutableState.channelData.value.ownCapabilities)
else -> it
}
}
mutableState.setChannelData(newChannelData)
}

Expand Down
Loading