aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorSteve Klebanoff <steve@0xproject.com>2018-10-25 04:22:04 +0800
committerGitHub <noreply@github.com>2018-10-25 04:22:04 +0800
commit979527a5ee3efaf2974703b91b0af3440195219e (patch)
tree83693ace2b44420db7942b67ff28ec0577fc120c /packages/instant/src/containers
parent059868e9942fed4616750d212e706f09d17f397b (diff)
parent05ce8aa124ae4d912ef43a9cf70a30ac2704867a (diff)
downloaddexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar.gz
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar.bz2
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar.lz
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar.xz
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.tar.zst
dexon-sol-tools-979527a5ee3efaf2974703b91b0af3440195219e.zip
Merge pull request #1180 from 0xProject/feature/instant/metamask-denial
[instant]Message when signature denied
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/selected_asset_buy_button.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/instant/src/containers/selected_asset_buy_button.ts b/packages/instant/src/containers/selected_asset_buy_button.ts
index 71d2b8cf0..428939e79 100644
--- a/packages/instant/src/containers/selected_asset_buy_button.ts
+++ b/packages/instant/src/containers/selected_asset_buy_button.ts
@@ -21,6 +21,7 @@ interface ConnectedDispatch {
onClick: (buyQuote: BuyQuote) => void;
onBuySuccess: (buyQuote: BuyQuote, txnHash: string) => void;
onBuyFailure: (buyQuote: BuyQuote) => void;
+ onBuyPrevented: (buyQuote: BuyQuote, error: Error) => void;
}
const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyButtonProps): ConnectedState => ({
@@ -33,6 +34,10 @@ const mapDispatchToProps = (dispatch: Dispatch<Action>, ownProps: SelectedAssetB
onBuySuccess: (buyQuote: BuyQuote, txnHash: string) =>
dispatch(actions.updateBuyOrderState({ processState: AsyncProcessState.SUCCESS, txnHash })),
onBuyFailure: buyQuote => dispatch(actions.updateBuyOrderState({ processState: AsyncProcessState.FAILURE })),
+ onBuyPrevented: (buyQuote, error) => {
+ dispatch(actions.resetAmount());
+ dispatch(actions.setError(error));
+ },
});
export const SelectedAssetBuyButton: React.ComponentClass<SelectedAssetBuyButtonProps> = connect(