We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e3af285 + bedc786 commit 442ec8cCopy full SHA for 442ec8c
src/components/ChannelList.js
@@ -188,7 +188,24 @@ const ChannelList = withChatContext(
188
this.listenToChanges();
189
}
190
191
- componentDidUpdate() {
+ async componentDidUpdate(prevProps) {
192
+ // do we need deepequal?
193
+ if (
194
+ !isEqual(prevProps.filters, this.props.filters) ||
195
+ !isEqual(prevProps.sort, this.props.sort)
196
+ ) {
197
+ await this.setState({
198
+ error: false,
199
+ channels: Immutable([]),
200
+ channelIds: Immutable([]),
201
+ loadingChannels: true,
202
+ hasNextPage: true,
203
+ refreshing: false,
204
+ offset: 0,
205
+ });
206
+ await this.queryChannels();
207
+ }
208
+
209
this.props.logger('ChannelList component', 'componentDidUpdate', {
210
tags: ['lifecycle', 'channellist'],
211
props: this.props,
0 commit comments