diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 434826f..186b0a0 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -142,6 +142,7 @@ const CLAIM_REPOST_STARTED = 'CLAIM_REPOST_STARTED'; const CLAIM_REPOST_COMPLETED = 'CLAIM_REPOST_COMPLETED'; const CLAIM_REPOST_FAILED = 'CLAIM_REPOST_FAILED'; const CLEAR_REPOST_ERROR = 'CLEAR_REPOST_ERROR'; +const CLEAR_CHANNEL_ERRORS = 'CLEAR_CHANNEL_ERRORS'; const CHECK_PUBLISH_NAME_STARTED = 'CHECK_PUBLISH_NAME_STARTED'; const CHECK_PUBLISH_NAME_COMPLETED = 'CHECK_PUBLISH_NAME_COMPLETED'; const UPDATE_PENDING_CLAIMS = 'UPDATE_PENDING_CLAIMS'; @@ -426,6 +427,7 @@ var action_types = /*#__PURE__*/Object.freeze({ CLAIM_REPOST_COMPLETED: CLAIM_REPOST_COMPLETED, CLAIM_REPOST_FAILED: CLAIM_REPOST_FAILED, CLEAR_REPOST_ERROR: CLEAR_REPOST_ERROR, + CLEAR_CHANNEL_ERRORS: CLEAR_CHANNEL_ERRORS, CHECK_PUBLISH_NAME_STARTED: CHECK_PUBLISH_NAME_STARTED, CHECK_PUBLISH_NAME_COMPLETED: CHECK_PUBLISH_NAME_COMPLETED, UPDATE_PENDING_CLAIMS: UPDATE_PENDING_CLAIMS, @@ -3490,6 +3492,12 @@ function doFetchClaimsByChannel(uri, page = 1) { }; } +function doClearChannelErrors() { + return { + type: CLEAR_CHANNEL_ERRORS + }; +} + function doCreateChannel(name, amount, optionalParams, cb) { return dispatch => { dispatch({ @@ -3548,7 +3556,6 @@ function doCreateChannel(name, amount, optionalParams, cb) { type: CREATE_CHANNEL_FAILED, data: error.message }); - return error; }); }; } @@ -5517,6 +5524,11 @@ reducers[ABANDON_CLAIM_SUCCEEDED] = (state, action) => { }); }; +reducers[CLEAR_CHANNEL_ERRORS] = state => _extends$b({}, state, { + createChannelError: null, + updateChannelError: null +}); + reducers[CREATE_CHANNEL_STARTED] = state => _extends$b({}, state, { creatingChannel: true, createChannelError: null @@ -6971,6 +6983,7 @@ exports.doCheckPendingClaims = doCheckPendingClaims; exports.doCheckPublishNameAvailability = doCheckPublishNameAvailability; exports.doCheckReflectingFiles = doCheckReflectingFiles; exports.doClaimSearch = doClaimSearch; +exports.doClearChannelErrors = doClearChannelErrors; exports.doClearPublish = doClearPublish; exports.doClearPurchasedUriSuccess = doClearPurchasedUriSuccess; exports.doClearRepostError = doClearRepostError; diff --git a/src/constants/action_types.js b/src/constants/action_types.js index b14cfb8..87e4295 100644 --- a/src/constants/action_types.js +++ b/src/constants/action_types.js @@ -119,6 +119,7 @@ export const CLAIM_REPOST_STARTED = 'CLAIM_REPOST_STARTED'; export const CLAIM_REPOST_COMPLETED = 'CLAIM_REPOST_COMPLETED'; export const CLAIM_REPOST_FAILED = 'CLAIM_REPOST_FAILED'; export const CLEAR_REPOST_ERROR = 'CLEAR_REPOST_ERROR'; +export const CLEAR_CHANNEL_ERRORS = 'CLEAR_CHANNEL_ERRORS'; export const CHECK_PUBLISH_NAME_STARTED = 'CHECK_PUBLISH_NAME_STARTED'; export const CHECK_PUBLISH_NAME_COMPLETED = 'CHECK_PUBLISH_NAME_COMPLETED'; export const UPDATE_PENDING_CLAIMS = 'UPDATE_PENDING_CLAIMS'; diff --git a/src/index.js b/src/index.js index dcec873..ad996b7 100644 --- a/src/index.js +++ b/src/index.js @@ -74,6 +74,7 @@ export { doImportChannel, doRepost, doClearRepostError, + doClearChannelErrors, doCheckPublishNameAvailability, doPurchaseList, doCheckPendingClaims, diff --git a/src/redux/actions/claims.js b/src/redux/actions/claims.js index 615b7a6..d74cb32 100644 --- a/src/redux/actions/claims.js +++ b/src/redux/actions/claims.js @@ -339,6 +339,12 @@ export function doFetchClaimsByChannel(uri: string, page: number = 1) { }; } +export function doClearChannelErrors() { + return { + type: ACTIONS.CLEAR_CHANNEL_ERRORS, + }; +} + export function doCreateChannel(name: string, amount: number, optionalParams: any, cb: any) { return (dispatch: Dispatch) => { dispatch({ @@ -410,7 +416,6 @@ export function doCreateChannel(name: string, amount: number, optionalParams: an type: ACTIONS.CREATE_CHANNEL_FAILED, data: error.message, }); - return error; }) ); }; diff --git a/src/redux/reducers/claims.js b/src/redux/reducers/claims.js index b00b2e7..1de07d5 100644 --- a/src/redux/reducers/claims.js +++ b/src/redux/reducers/claims.js @@ -42,7 +42,7 @@ type State = { [number]: Array, }, }, - updateChannelError: string, + updateChannelError: ?string, updatingChannel: boolean, pendingChannelImport: string | boolean, repostLoading: boolean, @@ -467,6 +467,12 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State = }); }; +reducers[ACTIONS.CLEAR_CHANNEL_ERRORS] = (state: State): State => ({ + ...state, + createChannelError: null, + updateChannelError: null, +}); + reducers[ACTIONS.CREATE_CHANNEL_STARTED] = (state: State): State => ({ ...state, creatingChannel: true,