diff --git a/ui/component/channelBlockButton/view.jsx b/ui/component/channelBlockButton/view.jsx index a2dfa7a36..742205258 100644 --- a/ui/component/channelBlockButton/view.jsx +++ b/ui/component/channelBlockButton/view.jsx @@ -6,8 +6,8 @@ type Props = { uri: string, isBlocked: boolean, isBlockingOrUnBlocking: boolean, - doCommentModUnBlock: (string) => void, - doCommentModBlock: (string) => void, + doCommentModUnBlock: (string, boolean) => void, + doCommentModBlock: (string, boolean) => void, }; function ChannelBlockButton(props: Props) { @@ -15,9 +15,9 @@ function ChannelBlockButton(props: Props) { function handleClick() { if (isBlocked) { - doCommentModUnBlock(uri); + doCommentModUnBlock(uri, false); } else { - doCommentModBlock(uri); + doCommentModBlock(uri, false); } } @@ -30,8 +30,8 @@ function ChannelBlockButton(props: Props) { ? __('Unblocking...') : __('Unblock') : isBlockingOrUnBlocking - ? __('Blocking...') - : __('Block') + ? __('Blocking...') + : __('Block') } onClick={handleClick} /> diff --git a/ui/component/channelMuteButton/index.js b/ui/component/channelMuteButton/index.js index 4a9df8dee..781ae1880 100644 --- a/ui/component/channelMuteButton/index.js +++ b/ui/component/channelMuteButton/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { doToggleMuteChannel } from 'redux/actions/blocked'; +import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked'; import { makeSelectChannelIsMuted } from 'redux/selectors/blocked'; import ChannelMuteButton from './view'; @@ -8,5 +8,6 @@ const select = (state, props) => ({ }); export default connect(select, { - doToggleMuteChannel, + doChannelMute, + doChannelUnmute, })(ChannelMuteButton); diff --git a/ui/component/channelMuteButton/view.jsx b/ui/component/channelMuteButton/view.jsx index 53d4a4b0e..2ffa6866b 100644 --- a/ui/component/channelMuteButton/view.jsx +++ b/ui/component/channelMuteButton/view.jsx @@ -6,17 +6,26 @@ type Props = { uri: string, isMuted: boolean, channelClaim: ?ChannelClaim, - doToggleMuteChannel: (string) => void, + doChannelMute: (string, boolean) => void, + doChannelUnmute: (string, boolean) => void, }; function ChannelBlockButton(props: Props) { - const { uri, doToggleMuteChannel, isMuted } = props; + const { uri, doChannelMute, doChannelUnmute, isMuted } = props; + + function handleClick() { + if (isMuted) { + doChannelUnmute(uri, false); + } else { + doChannelMute(uri, false); + } + } return (