Blocklist page: fix perpetual spinner when trying to refresh with no channels
There's nothing to do when you don't have a channel, so hide the button and ensure redux fails gracefully.
This commit is contained in:
parent
0e391a3d78
commit
f38a15ee0d
2 changed files with 19 additions and 9 deletions
|
@ -221,6 +221,7 @@ function ListBlocked(props: Props) {
|
|||
|
||||
function getRefreshElem() {
|
||||
return (
|
||||
myChannelClaims && (
|
||||
<Button
|
||||
icon={ICONS.REFRESH}
|
||||
button="alt"
|
||||
|
@ -230,6 +231,7 @@ function ListBlocked(props: Props) {
|
|||
fetchModAmIList();
|
||||
}}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1055,6 +1055,10 @@ export function doFetchModBlockedList() {
|
|||
return async (dispatch: Dispatch, getState: GetState) => {
|
||||
const state = getState();
|
||||
const myChannels = selectMyChannelClaims(state);
|
||||
if (!myChannels) {
|
||||
dispatch({ type: ACTIONS.COMMENT_MODERATION_BLOCK_LIST_FAILED });
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: ACTIONS.COMMENT_MODERATION_BLOCK_LIST_STARTED,
|
||||
|
@ -1377,6 +1381,10 @@ export function doFetchCommentModAmIList(channelClaim: ChannelClaim) {
|
|||
return async (dispatch: Dispatch, getState: GetState) => {
|
||||
const state = getState();
|
||||
const myChannels = selectMyChannelClaims(state);
|
||||
if (!myChannels) {
|
||||
dispatch({ type: ACTIONS.COMMENT_MODERATION_AM_I_LIST_FAILED });
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({ type: ACTIONS.COMMENT_MODERATION_AM_I_LIST_STARTED });
|
||||
|
||||
|
|
Loading…
Reference in a new issue