1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Ensure state updates after accepting or rejecting a watched asset, to prevent navigation errors. (#14043)

This commit is contained in:
Dan J Miller 2022-03-24 13:56:38 -02:30 committed by GitHub
parent d15de941e3
commit b7e0fc860e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1579,6 +1579,7 @@ export function rejectWatchAsset(suggestedAssetID) {
dispatch(showLoadingIndication()); dispatch(showLoadingIndication());
try { try {
await promisifiedBackground.rejectWatchAsset(suggestedAssetID); await promisifiedBackground.rejectWatchAsset(suggestedAssetID);
await forceUpdateMetamaskState(dispatch);
} catch (error) { } catch (error) {
log.error(error); log.error(error);
dispatch(displayWarning(error.message)); dispatch(displayWarning(error.message));
@ -1595,6 +1596,7 @@ export function acceptWatchAsset(suggestedAssetID) {
dispatch(showLoadingIndication()); dispatch(showLoadingIndication());
try { try {
await promisifiedBackground.acceptWatchAsset(suggestedAssetID); await promisifiedBackground.acceptWatchAsset(suggestedAssetID);
await forceUpdateMetamaskState(dispatch);
} catch (error) { } catch (error) {
log.error(error); log.error(error);
dispatch(displayWarning(error.message)); dispatch(displayWarning(error.message));