Skip to content

Commit 23e9f8f

Browse files
author
Jaap
committed
allow changing of filters
1 parent e3af285 commit 23e9f8f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/components/ChannelList.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,22 @@ const ChannelList = withChatContext(
188188
this.listenToChanges();
189189
}
190190

191-
componentDidUpdate() {
191+
async componentDidUpdate(prevProps) {
192+
// do we need deepequal?
193+
if (!isEqual(prevProps.filters, this.props.filters)) {
194+
await this.setState({
195+
error: false,
196+
channels: Immutable([]),
197+
channelIds: Immutable([]),
198+
loadingChannels: true,
199+
hasNextPage: true,
200+
refreshing: false,
201+
offset: 0,
202+
});
203+
console.log('tets');
204+
await this.queryChannels();
205+
}
206+
192207
this.props.logger('ChannelList component', 'componentDidUpdate', {
193208
tags: ['lifecycle', 'channellist'],
194209
props: this.props,

0 commit comments

Comments
 (0)