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() {
|
function getRefreshElem() {
|
||||||
return (
|
return (
|
||||||
|
myChannelClaims && (
|
||||||
<Button
|
<Button
|
||||||
icon={ICONS.REFRESH}
|
icon={ICONS.REFRESH}
|
||||||
button="alt"
|
button="alt"
|
||||||
|
@ -230,6 +231,7 @@ function ListBlocked(props: Props) {
|
||||||
fetchModAmIList();
|
fetchModAmIList();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1055,6 +1055,10 @@ export function doFetchModBlockedList() {
|
||||||
return async (dispatch: Dispatch, getState: GetState) => {
|
return async (dispatch: Dispatch, getState: GetState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const myChannels = selectMyChannelClaims(state);
|
const myChannels = selectMyChannelClaims(state);
|
||||||
|
if (!myChannels) {
|
||||||
|
dispatch({ type: ACTIONS.COMMENT_MODERATION_BLOCK_LIST_FAILED });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.COMMENT_MODERATION_BLOCK_LIST_STARTED,
|
type: ACTIONS.COMMENT_MODERATION_BLOCK_LIST_STARTED,
|
||||||
|
@ -1377,6 +1381,10 @@ export function doFetchCommentModAmIList(channelClaim: ChannelClaim) {
|
||||||
return async (dispatch: Dispatch, getState: GetState) => {
|
return async (dispatch: Dispatch, getState: GetState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const myChannels = selectMyChannelClaims(state);
|
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 });
|
dispatch({ type: ACTIONS.COMMENT_MODERATION_AM_I_LIST_STARTED });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue