modifications
This commit is contained in:
parent
284cff48c2
commit
69f9562b01
4 changed files with 30 additions and 55 deletions
28
dist/bundle.es.js
vendored
28
dist/bundle.es.js
vendored
|
@ -1907,10 +1907,9 @@ function doFetchFilteredOutpoints() {
|
|||
const success = ({
|
||||
outpoints
|
||||
}) => {
|
||||
const splitedOutpoints = [];
|
||||
outpoints.forEach((outpoint, index) => {
|
||||
const formattedOutpoints = outpoints.map(outpoint => {
|
||||
const [txid, nout] = outpoint.split(':');
|
||||
splitedOutpoints[index] = {
|
||||
return {
|
||||
txid,
|
||||
nout: Number.parseInt(nout, 10)
|
||||
};
|
||||
|
@ -1918,8 +1917,7 @@ function doFetchFilteredOutpoints() {
|
|||
dispatch({
|
||||
type: FETCH_FILTERED_CONTENT_COMPLETED,
|
||||
data: {
|
||||
outpoints: splitedOutpoints,
|
||||
success: true
|
||||
outpoints: formattedOutpoints
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -1930,8 +1928,7 @@ function doFetchFilteredOutpoints() {
|
|||
dispatch({
|
||||
type: FETCH_FILTERED_CONTENT_FAILED,
|
||||
data: {
|
||||
error,
|
||||
success: false
|
||||
error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -2634,33 +2631,28 @@ const blacklistReducer = handleActions({
|
|||
}, defaultState$5);
|
||||
|
||||
const defaultState$6 = {
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: undefined,
|
||||
loading: false,
|
||||
filteredOutpoints: undefined
|
||||
};
|
||||
const filteredReducer = handleActions({
|
||||
[FETCH_FILTERED_CONTENT_STARTED]: state => ({ ...state,
|
||||
fetchingFilteredOutpoints: true
|
||||
loading: true
|
||||
}),
|
||||
[FETCH_FILTERED_CONTENT_COMPLETED]: (state, action) => {
|
||||
const {
|
||||
outpoints,
|
||||
success
|
||||
outpoints
|
||||
} = action.data;
|
||||
return { ...state,
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
filteredOutpoints: outpoints
|
||||
};
|
||||
},
|
||||
[FETCH_FILTERED_CONTENT_FAILED]: (state, action) => {
|
||||
const {
|
||||
error,
|
||||
success
|
||||
error
|
||||
} = action.data;
|
||||
return { ...state,
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
fetchingFilteredOutpointsError: error
|
||||
};
|
||||
}
|
||||
|
|
30
dist/bundle.js
vendored
30
dist/bundle.js
vendored
|
@ -3325,14 +3325,13 @@ function doFetchFilteredOutpoints() {
|
|||
|
||||
var success = function success(_ref) {
|
||||
var outpoints = _ref.outpoints;
|
||||
var splitedOutpoints = [];
|
||||
outpoints.forEach(function (outpoint, index) {
|
||||
var formattedOutpoints = outpoints.map(function (outpoint) {
|
||||
var _outpoint$split = outpoint.split(':'),
|
||||
_outpoint$split2 = _slicedToArray(_outpoint$split, 2),
|
||||
txid = _outpoint$split2[0],
|
||||
nout = _outpoint$split2[1];
|
||||
|
||||
splitedOutpoints[index] = {
|
||||
return {
|
||||
txid: txid,
|
||||
nout: Number.parseInt(nout, 10)
|
||||
};
|
||||
|
@ -3340,8 +3339,7 @@ function doFetchFilteredOutpoints() {
|
|||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["FETCH_FILTERED_CONTENT_COMPLETED"],
|
||||
data: {
|
||||
outpoints: splitedOutpoints,
|
||||
success: true
|
||||
outpoints: formattedOutpoints
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -3351,8 +3349,7 @@ function doFetchFilteredOutpoints() {
|
|||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["FETCH_FILTERED_CONTENT_FAILED"],
|
||||
data: {
|
||||
error: error,
|
||||
success: false
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -4247,30 +4244,23 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|||
|
||||
|
||||
var defaultState = {
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: undefined,
|
||||
loading: false,
|
||||
filteredOutpoints: undefined
|
||||
};
|
||||
var filteredReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_1__["handleActions"])((_handleActions = {}, _defineProperty(_handleActions, constants_action_types__WEBPACK_IMPORTED_MODULE_0__["FETCH_FILTERED_CONTENT_STARTED"], function (state) {
|
||||
return _objectSpread({}, state, {
|
||||
fetchingFilteredOutpoints: true
|
||||
loading: true
|
||||
});
|
||||
}), _defineProperty(_handleActions, constants_action_types__WEBPACK_IMPORTED_MODULE_0__["FETCH_FILTERED_CONTENT_COMPLETED"], function (state, action) {
|
||||
var _action$data = action.data,
|
||||
outpoints = _action$data.outpoints,
|
||||
success = _action$data.success;
|
||||
var outpoints = action.data.outpoints;
|
||||
return _objectSpread({}, state, {
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
filteredOutpoints: outpoints
|
||||
});
|
||||
}), _defineProperty(_handleActions, constants_action_types__WEBPACK_IMPORTED_MODULE_0__["FETCH_FILTERED_CONTENT_FAILED"], function (state, action) {
|
||||
var _action$data2 = action.data,
|
||||
error = _action$data2.error,
|
||||
success = _action$data2.success;
|
||||
var error = action.data.error;
|
||||
return _objectSpread({}, state, {
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
fetchingFilteredOutpointsError: error
|
||||
});
|
||||
}), _handleActions), defaultState);
|
||||
|
|
|
@ -10,18 +10,15 @@ export function doFetchFilteredOutpoints() {
|
|||
});
|
||||
|
||||
const success = ({ outpoints }) => {
|
||||
const splitedOutpoints = [];
|
||||
|
||||
outpoints.forEach((outpoint, index) => {
|
||||
const formattedOutpoints = outpoints.map(outpoint => {
|
||||
const [txid, nout] = outpoint.split(':');
|
||||
|
||||
splitedOutpoints[index] = { txid, nout: Number.parseInt(nout, 10) };
|
||||
return { txid, nout: Number.parseInt(nout, 10) };
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: ACTIONS.FETCH_FILTERED_CONTENT_COMPLETED,
|
||||
data: {
|
||||
outpoints: splitedOutpoints,
|
||||
success: true,
|
||||
outpoints: formattedOutpoints,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
@ -31,7 +28,6 @@ export function doFetchFilteredOutpoints() {
|
|||
type: ACTIONS.FETCH_FILTERED_CONTENT_FAILED,
|
||||
data: {
|
||||
error,
|
||||
success: false,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -2,8 +2,7 @@ import * as ACTIONS from 'constants/action_types';
|
|||
import { handleActions } from 'util/redux-utils';
|
||||
|
||||
const defaultState = {
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: undefined,
|
||||
loading: false,
|
||||
filteredOutpoints: undefined,
|
||||
};
|
||||
|
||||
|
@ -11,24 +10,22 @@ export const filteredReducer = handleActions(
|
|||
{
|
||||
[ACTIONS.FETCH_FILTERED_CONTENT_STARTED]: state => ({
|
||||
...state,
|
||||
fetchingFilteredOutpoints: true,
|
||||
loading: true,
|
||||
}),
|
||||
[ACTIONS.FETCH_FILTERED_CONTENT_COMPLETED]: (state, action) => {
|
||||
const { outpoints, success } = action.data;
|
||||
const { outpoints } = action.data;
|
||||
return {
|
||||
...state,
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
filteredOutpoints: outpoints,
|
||||
};
|
||||
},
|
||||
[ACTIONS.FETCH_FILTERED_CONTENT_FAILED]: (state, action) => {
|
||||
const { error, success } = action.data;
|
||||
const { error } = action.data;
|
||||
|
||||
return {
|
||||
...state,
|
||||
fetchingFilteredOutpoints: false,
|
||||
fetchingFilteredOutpointsSucceed: success,
|
||||
loading: false,
|
||||
fetchingFilteredOutpointsError: error,
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue