provide walletReconnecting state in wallet reducer #255

Merged
jessopb merged 1 commit from feat-reconnectStatus into master 2019-12-19 17:26:42 +01:00
4 changed files with 29 additions and 1 deletions
Showing only changes of commit 74eba1f297 - Show all commits

13
dist/bundle.es.js vendored
View file

@ -1829,6 +1829,8 @@ const makeSelectLatestTransactions = reselect.createSelector(selectTransactionIt
const selectFilteredTransactionCount = reselect.createSelector(selectFilteredTransactions, filteredTransactions => filteredTransactions.length);
const selectIsWalletReconnecting = reselect.createSelector(selectState$1, state => state.walletReconnecting);
var _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties$1(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
@ -5169,7 +5171,8 @@ const defaultState$a = {
walletLockPending: false,
walletLockSucceded: null,
walletLockResult: null,
transactionListFilter: 'all'
transactionListFilter: 'all',
walletReconnecting: false
};
const walletReducer = handleActions({
@ -5391,6 +5394,13 @@ const walletReducer = handleActions({
[UPDATE_CURRENT_HEIGHT]: (state, action) => _extends$f({}, state, {
latestBlock: action.data
}),
[WALLET_RESTART]: state => _extends$f({}, state, {
walletReconnecting: true
}),
[WALLET_RESTART_COMPLETED]: state => _extends$f({}, state, {
walletReconnecting: false
})
}, defaultState$a);
@ -5701,6 +5711,7 @@ exports.selectIsResolvingPublishUris = selectIsResolvingPublishUris;
exports.selectIsSearching = selectIsSearching;
exports.selectIsSendingSupport = selectIsSendingSupport;
exports.selectIsStillEditing = selectIsStillEditing;
exports.selectIsWalletReconnecting = selectIsWalletReconnecting;
exports.selectLastPurchasedUri = selectLastPurchasedUri;
exports.selectMyActiveClaims = selectMyActiveClaims;
exports.selectMyChannelClaims = selectMyChannelClaims;

View file

@ -312,6 +312,7 @@ export {
makeSelectLatestTransactions,
makeSelectFilteredTransactionsForPage,
selectFilteredTransactionCount,
selectIsWalletReconnecting,
} from 'redux/selectors/wallet';
export {

View file

@ -42,6 +42,7 @@ type WalletState = {
walletLockPending: boolean,
walletLockSucceded: ?boolean,
walletLockResult: ?boolean,
walletReconnecting: boolean,
};
const defaultState = {
@ -74,6 +75,7 @@ const defaultState = {
walletLockSucceded: null,
walletLockResult: null,
transactionListFilter: 'all',
walletReconnecting: false,
};
export const walletReducer = handleActions(
@ -326,6 +328,15 @@ export const walletReducer = handleActions(
...state,
latestBlock: action.data,
}),
[ACTIONS.WALLET_RESTART]: (state: WalletState) => ({
...state,
walletReconnecting: true,
}),
[ACTIONS.WALLET_RESTART_COMPLETED]: (state: WalletState) => ({
...state,
walletReconnecting: false,
}),
},
defaultState
);

View file

@ -323,3 +323,8 @@ export const selectFilteredTransactionCount = createSelector(
selectFilteredTransactions,
filteredTransactions => filteredTransactions.length
);
export const selectIsWalletReconnecting = createSelector(
selectState,
state => state.walletReconnecting
);