Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show "error refreshing stakepool data" error msg only in legacy mode #3561

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions app/actions/VSPActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,12 @@ export const REFRESHSTAKEPOOLPURCHASEINFORMATION_FAILED =

// refreshStakepoolPurchaseInformation is used during wallet startup to grab
// fresh information (eg: latest pool fee) from all configured stakepools.
export const refreshStakepoolPurchaseInformation = () => (dispatch, getState) =>
Promise.all(
export const refreshStakepoolPurchaseInformation = () => (
dispatch,
getState
) => {
const isLegacy = sel.getIsLegacy(getState());
return Promise.all(
sel.configuredStakePools(getState()).map(({ Host, ApiKey }) => {
wallet.allowStakePoolHost(Host);
wallet
Expand All @@ -295,15 +299,19 @@ export const refreshStakepoolPurchaseInformation = () => (dispatch, getState) =>
? dispatch(updateSavedConfig(response.data.data, Host))
: null
)
.catch((error) =>
dispatch({
error,
host: Host,
type: REFRESHSTAKEPOOLPURCHASEINFORMATION_FAILED
})
);
.catch((error) => {
// not give an error in legacy mode
if (isLegacy) {
dispatch({
error,
host: Host,
type: REFRESHSTAKEPOOLPURCHASEINFORMATION_FAILED
});
}
});
})
);
};

// setStakePoolInformation links a new stakepool to the wallet. This
// will contact the given stakepool, link it with an address from the wallet in
Expand Down