add case for channel_list failing

This commit is contained in:
Sean Yesmunt 2020-06-01 14:26:07 -04:00
parent f379c724bb
commit b2d49c2755
4 changed files with 31 additions and 2 deletions

17
dist/bundle.es.js vendored
View file

@ -115,6 +115,7 @@ const ABANDON_CLAIM_STARTED = 'ABANDON_CLAIM_STARTED';
const ABANDON_CLAIM_SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED';
const FETCH_CHANNEL_LIST_STARTED = 'FETCH_CHANNEL_LIST_STARTED';
const FETCH_CHANNEL_LIST_COMPLETED = 'FETCH_CHANNEL_LIST_COMPLETED';
const FETCH_CHANNEL_LIST_FAILED = 'FETCH_CHANNEL_LIST_FAILED';
const CREATE_CHANNEL_STARTED = 'CREATE_CHANNEL_STARTED';
const CREATE_CHANNEL_COMPLETED = 'CREATE_CHANNEL_COMPLETED';
const CREATE_CHANNEL_FAILED = 'CREATE_CHANNEL_FAILED';
@ -399,6 +400,7 @@ var action_types = /*#__PURE__*/Object.freeze({
ABANDON_CLAIM_SUCCEEDED: ABANDON_CLAIM_SUCCEEDED,
FETCH_CHANNEL_LIST_STARTED: FETCH_CHANNEL_LIST_STARTED,
FETCH_CHANNEL_LIST_COMPLETED: FETCH_CHANNEL_LIST_COMPLETED,
FETCH_CHANNEL_LIST_FAILED: FETCH_CHANNEL_LIST_FAILED,
CREATE_CHANNEL_STARTED: CREATE_CHANNEL_STARTED,
CREATE_CHANNEL_COMPLETED: CREATE_CHANNEL_COMPLETED,
CREATE_CHANNEL_FAILED: CREATE_CHANNEL_FAILED,
@ -3655,7 +3657,14 @@ function doFetchChannelListMine(page = 1, pageSize = 99999, resolve = true) {
});
};
lbryProxy.channel_list({ page, page_size: pageSize, resolve }).then(callback);
const failure = error => {
dispatch({
type: FETCH_CHANNEL_LIST_FAILED,
data: error
});
};
lbryProxy.channel_list({ page, page_size: pageSize, resolve }).then(callback, failure);
};
}
@ -5345,6 +5354,12 @@ reducers[FETCH_CHANNEL_LIST_COMPLETED] = (state, action) => {
});
};
reducers[FETCH_CHANNEL_LIST_FAILED] = (state, action) => {
return Object.assign({}, state, {
fetchingMyChannels: false
});
};
reducers[FETCH_CHANNEL_CLAIMS_STARTED] = (state, action) => {
const { uri, page } = action.data;
const fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);

View file

@ -91,6 +91,7 @@ export const ABANDON_CLAIM_STARTED = 'ABANDON_CLAIM_STARTED';
export const ABANDON_CLAIM_SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED';
export const FETCH_CHANNEL_LIST_STARTED = 'FETCH_CHANNEL_LIST_STARTED';
export const FETCH_CHANNEL_LIST_COMPLETED = 'FETCH_CHANNEL_LIST_COMPLETED';
export const FETCH_CHANNEL_LIST_FAILED = 'FETCH_CHANNEL_LIST_FAILED';
export const CREATE_CHANNEL_STARTED = 'CREATE_CHANNEL_STARTED';
export const CREATE_CHANNEL_COMPLETED = 'CREATE_CHANNEL_COMPLETED';
export const CREATE_CHANNEL_FAILED = 'CREATE_CHANNEL_FAILED';

View file

@ -502,7 +502,14 @@ export function doFetchChannelListMine(
});
};
Lbry.channel_list({ page, page_size: pageSize, resolve }).then(callback);
const failure = error => {
dispatch({
type: ACTIONS.FETCH_CHANNEL_LIST_FAILED,
data: error,
});
};
Lbry.channel_list({ page, page_size: pageSize, resolve }).then(callback, failure);
};
}

View file

@ -300,6 +300,12 @@ reducers[ACTIONS.FETCH_CHANNEL_LIST_COMPLETED] = (state: State, action: any): St
});
};
reducers[ACTIONS.FETCH_CHANNEL_LIST_FAILED] = (state: State, action: any): State => {
return Object.assign({}, state, {
fetchingMyChannels: false,
});
};
reducers[ACTIONS.FETCH_CHANNEL_CLAIMS_STARTED] = (state: State, action: any): State => {
const { uri, page } = action.data;
const fetchingChannelClaims = Object.assign({}, state.fetchingChannelClaims);