-
Notifications
You must be signed in to change notification settings - Fork 386
[MM-10430] Add selector to check if the channel is hidden #493
Conversation
Update: While working on Mobile RN, I realized that there are some store related implementation in webapp that is needed by mobile RN as well. This update moves the "hiddenDefaultChannelId" here which was initially introduced at webapp. @lieut-data Sorry but you might want to take a look again. |
@saturninoabril, will do! Sometimes I miss comments, though, so feel free to always re-add me as a reviewer to put it in my https://github.com/pulls/review-requested list :) |
test/actions/channels.test.js
Outdated
state = store.getState(); | ||
hiddenChannel = state.entities.channels.hiddenDefaultChannelId; | ||
assert.ok(hiddenChannel); | ||
assert.ok(!hiddenChannel[teamId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding test cases for when the teamId
or channelId
is falsy
when passed to the action creators?
src/reducers/entities/channels.js
Outdated
@@ -382,6 +382,27 @@ function stats(state = {}, action) { | |||
} | |||
} | |||
|
|||
function hiddenDefaultChannelId(state = {}, action) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding a test case for this reducer as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to come back to this a few days after it was submitted, but why do we need to store the ID of the town square channels? Why can't we just have a selector that looks through the channels on the given team and returns the town square?
Thanks @hmhealey and @lieut-data! |
…p to make it accessible to mobile RN as well
Signed-off-by: Saturnino Abril <[email protected]>
@lieut-data @hmhealey I've updated the PR and just retain the selector |
Summary
Add selector to check if the channel is hidden
(Didn't added a test as I'm not sure how to effectively test it. Will try to revisit next time)
Server PR - mattermost/mattermost#8751
Webapp PR - mattermost/mattermost-webapp#1194
Ticket Link
Jira ticket: MM-10430