2020-07-15 15:50:08 +02:00
|
|
|
// @flow
|
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
|
|
|
const selectState = (state: { blocked: BlocklistState }) => state.blocked || {};
|
|
|
|
|
2021-02-25 18:43:56 +01:00
|
|
|
export const selectMutedChannels = createSelector(selectState, (state: BlocklistState) => {
|
|
|
|
return state.blockedChannels.filter((e) => typeof e === 'string');
|
2020-08-24 19:56:26 +02:00
|
|
|
});
|
2020-07-15 15:50:08 +02:00
|
|
|
|
2021-02-25 18:43:56 +01:00
|
|
|
export const makeSelectChannelIsMuted = (uri: string) =>
|
|
|
|
createSelector(selectMutedChannels, (state: Array<string>) => {
|
2020-07-15 15:50:08 +02:00
|
|
|
return state.includes(uri);
|
|
|
|
});
|