diff --git a/src/index.js b/src/index.js index 8f03f36..1d28615 100644 --- a/src/index.js +++ b/src/index.js @@ -273,4 +273,4 @@ export { export { selectFollowedTags, selectUnfollowedTags } from 'redux/selectors/tags'; -export { selectBlockedChannels, selectChannelIsBlocked } from 'redux/selectors/blocked'; +export { selectBlockedChannels, selectChannelIsBlocked, selectBlockedChannelsCount } from 'redux/selectors/blocked'; diff --git a/src/redux/reducers/blocked.js b/src/redux/reducers/blocked.js index 92f9200..dc90d01 100644 --- a/src/redux/reducers/blocked.js +++ b/src/redux/reducers/blocked.js @@ -11,7 +11,6 @@ export const blockChannelReducer = handleActions( [ACTIONS.TOGGLE_BLOCK_CHANNEL]: (state: BlocklistState, action: BlocklistAction): BlocklistState => { const { blockedChannels } = state; const { uri } = action.data; - console.log('test', uri) let newBlockedChannels = blockedChannels.slice(); if (newBlockedChannels.includes(uri)) { diff --git a/src/redux/selectors/blocked.js b/src/redux/selectors/blocked.js index 7ab7af5..a5946a8 100644 --- a/src/redux/selectors/blocked.js +++ b/src/redux/selectors/blocked.js @@ -5,7 +5,12 @@ const selectState = (state: { blockedChannels: BlocklistState }) => state.blocke export const selectBlockedChannels = createSelector( selectState, - (state: BlocklistState) => state + (state: BlocklistState) => state.blockedChannels +); + +export const selectBlockedChannelsCount = createSelector( + selectState, + (state: BlocklistState) => state.blockedChannels.length ); export const selectChannelIsBlocked = (uri: string) => createSelector(