Merge pull request #255 from lbryio/feat-reconnectStatus
provide walletReconnecting state in wallet reducer
This commit is contained in:
commit
04615f0d6b
4 changed files with 29 additions and 1 deletions
13
dist/bundle.es.js
vendored
13
dist/bundle.es.js
vendored
|
@ -1829,6 +1829,8 @@ const makeSelectLatestTransactions = reselect.createSelector(selectTransactionIt
|
||||||
|
|
||||||
const selectFilteredTransactionCount = reselect.createSelector(selectFilteredTransactions, filteredTransactions => filteredTransactions.length);
|
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; };
|
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; }
|
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,
|
walletLockPending: false,
|
||||||
walletLockSucceded: null,
|
walletLockSucceded: null,
|
||||||
walletLockResult: null,
|
walletLockResult: null,
|
||||||
transactionListFilter: 'all'
|
transactionListFilter: 'all',
|
||||||
|
walletReconnecting: false
|
||||||
};
|
};
|
||||||
|
|
||||||
const walletReducer = handleActions({
|
const walletReducer = handleActions({
|
||||||
|
@ -5391,6 +5394,13 @@ const walletReducer = handleActions({
|
||||||
|
|
||||||
[UPDATE_CURRENT_HEIGHT]: (state, action) => _extends$f({}, state, {
|
[UPDATE_CURRENT_HEIGHT]: (state, action) => _extends$f({}, state, {
|
||||||
latestBlock: action.data
|
latestBlock: action.data
|
||||||
|
}),
|
||||||
|
[WALLET_RESTART]: state => _extends$f({}, state, {
|
||||||
|
walletReconnecting: true
|
||||||
|
}),
|
||||||
|
|
||||||
|
[WALLET_RESTART_COMPLETED]: state => _extends$f({}, state, {
|
||||||
|
walletReconnecting: false
|
||||||
})
|
})
|
||||||
}, defaultState$a);
|
}, defaultState$a);
|
||||||
|
|
||||||
|
@ -5701,6 +5711,7 @@ exports.selectIsResolvingPublishUris = selectIsResolvingPublishUris;
|
||||||
exports.selectIsSearching = selectIsSearching;
|
exports.selectIsSearching = selectIsSearching;
|
||||||
exports.selectIsSendingSupport = selectIsSendingSupport;
|
exports.selectIsSendingSupport = selectIsSendingSupport;
|
||||||
exports.selectIsStillEditing = selectIsStillEditing;
|
exports.selectIsStillEditing = selectIsStillEditing;
|
||||||
|
exports.selectIsWalletReconnecting = selectIsWalletReconnecting;
|
||||||
exports.selectLastPurchasedUri = selectLastPurchasedUri;
|
exports.selectLastPurchasedUri = selectLastPurchasedUri;
|
||||||
exports.selectMyActiveClaims = selectMyActiveClaims;
|
exports.selectMyActiveClaims = selectMyActiveClaims;
|
||||||
exports.selectMyChannelClaims = selectMyChannelClaims;
|
exports.selectMyChannelClaims = selectMyChannelClaims;
|
||||||
|
|
|
@ -312,6 +312,7 @@ export {
|
||||||
makeSelectLatestTransactions,
|
makeSelectLatestTransactions,
|
||||||
makeSelectFilteredTransactionsForPage,
|
makeSelectFilteredTransactionsForPage,
|
||||||
selectFilteredTransactionCount,
|
selectFilteredTransactionCount,
|
||||||
|
selectIsWalletReconnecting,
|
||||||
} from 'redux/selectors/wallet';
|
} from 'redux/selectors/wallet';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -42,6 +42,7 @@ type WalletState = {
|
||||||
walletLockPending: boolean,
|
walletLockPending: boolean,
|
||||||
walletLockSucceded: ?boolean,
|
walletLockSucceded: ?boolean,
|
||||||
walletLockResult: ?boolean,
|
walletLockResult: ?boolean,
|
||||||
|
walletReconnecting: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultState = {
|
const defaultState = {
|
||||||
|
@ -74,6 +75,7 @@ const defaultState = {
|
||||||
walletLockSucceded: null,
|
walletLockSucceded: null,
|
||||||
walletLockResult: null,
|
walletLockResult: null,
|
||||||
transactionListFilter: 'all',
|
transactionListFilter: 'all',
|
||||||
|
walletReconnecting: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const walletReducer = handleActions(
|
export const walletReducer = handleActions(
|
||||||
|
@ -326,6 +328,15 @@ export const walletReducer = handleActions(
|
||||||
...state,
|
...state,
|
||||||
latestBlock: action.data,
|
latestBlock: action.data,
|
||||||
}),
|
}),
|
||||||
|
[ACTIONS.WALLET_RESTART]: (state: WalletState) => ({
|
||||||
|
...state,
|
||||||
|
walletReconnecting: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
[ACTIONS.WALLET_RESTART_COMPLETED]: (state: WalletState) => ({
|
||||||
|
...state,
|
||||||
|
walletReconnecting: false,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
defaultState
|
defaultState
|
||||||
);
|
);
|
||||||
|
|
|
@ -323,3 +323,8 @@ export const selectFilteredTransactionCount = createSelector(
|
||||||
selectFilteredTransactions,
|
selectFilteredTransactions,
|
||||||
filteredTransactions => filteredTransactions.length
|
filteredTransactions => filteredTransactions.length
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectIsWalletReconnecting = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.walletReconnecting
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue