Merge branch 'develop' into release/3.4.0
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
- [[#871]](https://github.com/GetStream/stream-chat-flutter/issues/871) Fixed thread message deletion.
|
- [[#871]](https://github.com/GetStream/stream-chat-flutter/issues/871) Fixed thread message deletion.
|
||||||
- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated when receiving a reaction event.
|
- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated when receiving a reaction event.
|
||||||
- Add check for invalid image URLs
|
- Add check for invalid image URLs
|
||||||
|
- Fix `channelState.pinnedMessagesStream` getting reset to `0` after a channel update.
|
||||||
|
|
||||||
🔄 Changed
|
🔄 Changed
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import 'package:stream_chat/src/core/models/user.dart';
|
|||||||
|
|
||||||
part 'channel_state.g.dart';
|
part 'channel_state.g.dart';
|
||||||
|
|
||||||
|
const _emptyPinnedMessages = <Message>[];
|
||||||
|
|
||||||
/// The class that contains the information about a channel
|
/// The class that contains the information about a channel
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class ChannelState {
|
class ChannelState {
|
||||||
@@ -15,7 +17,7 @@ class ChannelState {
|
|||||||
this.channel,
|
this.channel,
|
||||||
this.messages = const [],
|
this.messages = const [],
|
||||||
this.members = const [],
|
this.members = const [],
|
||||||
this.pinnedMessages = const [],
|
this.pinnedMessages = _emptyPinnedMessages,
|
||||||
this.watcherCount,
|
this.watcherCount,
|
||||||
this.watchers = const [],
|
this.watchers = const [],
|
||||||
this.read = const [],
|
this.read = const [],
|
||||||
@@ -63,7 +65,11 @@ class ChannelState {
|
|||||||
channel: channel ?? this.channel,
|
channel: channel ?? this.channel,
|
||||||
messages: messages ?? this.messages,
|
messages: messages ?? this.messages,
|
||||||
members: members ?? this.members,
|
members: members ?? this.members,
|
||||||
pinnedMessages: pinnedMessages ?? this.pinnedMessages,
|
// Hack to avoid using the default value in case nothing is provided.
|
||||||
|
// FIXME: Use non-nullable by default instead of empty list.
|
||||||
|
pinnedMessages: pinnedMessages == _emptyPinnedMessages
|
||||||
|
? this.pinnedMessages
|
||||||
|
: pinnedMessages ?? _emptyPinnedMessages,
|
||||||
watcherCount: watcherCount ?? this.watcherCount,
|
watcherCount: watcherCount ?? this.watcherCount,
|
||||||
watchers: watchers ?? this.watchers,
|
watchers: watchers ?? this.watchers,
|
||||||
read: read ?? this.read,
|
read: read ?? this.read,
|
||||||
|
|||||||
Reference in New Issue
Block a user