From d36c8748e320ae665b3389bbc32b487bfab401f2 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Tue, 8 Jun 2021 01:37:33 +0800 Subject: [PATCH] Add button to re-fetch Mod Blocklist ... otherwise, a full F5 reload is needed. --- ui/page/listBlocked/index.js | 7 ++++++- ui/page/listBlocked/view.jsx | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/page/listBlocked/index.js b/ui/page/listBlocked/index.js index dc72bbaeb..5ac1fd595 100644 --- a/ui/page/listBlocked/index.js +++ b/ui/page/listBlocked/index.js @@ -1,4 +1,5 @@ import { connect } from 'react-redux'; +import { doFetchModBlockedList } from 'redux/actions/comments'; import { selectMutedChannels } from 'redux/selectors/blocked'; import { selectModerationBlockList, selectFetchingModerationBlockList } from 'redux/selectors/comments'; import ListBlocked from './view'; @@ -9,4 +10,8 @@ const select = (state) => ({ fetchingModerationBlockList: selectFetchingModerationBlockList(state), }); -export default connect(select)(ListBlocked); +const perform = (dispatch) => ({ + fetchModBlockedList: () => dispatch(doFetchModBlockedList()), +}); + +export default connect(select, perform)(ListBlocked); diff --git a/ui/page/listBlocked/view.jsx b/ui/page/listBlocked/view.jsx index 7f33e9b17..39fba914e 100644 --- a/ui/page/listBlocked/view.jsx +++ b/ui/page/listBlocked/view.jsx @@ -15,13 +15,14 @@ type Props = { mutedUris: ?Array, blockedUris: ?Array, fetchingModerationBlockList: boolean, + fetchModBlockedList: () => void, }; const VIEW_BLOCKED = 'blocked'; const VIEW_MUTED = 'muted'; function ListBlocked(props: Props) { - const { mutedUris, blockedUris, fetchingModerationBlockList } = props; + const { mutedUris, blockedUris, fetchingModerationBlockList, fetchModBlockedList } = props; const [viewMode, setViewMode] = usePersistedState('blocked-muted:display', VIEW_BLOCKED); // Keep a local list to allow for undoing actions in this component @@ -100,6 +101,9 @@ function ListBlocked(props: Props) { onClick={() => setViewMode(VIEW_MUTED)} /> +
+
{showUris &&
{viewMode === VIEW_MUTED ? mutedHelpText : blockedHelpText}
}