From dbf9760780fc3dd3244a442108a433fa9cffa883 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 21 Nov 2018 11:23:38 +0100 Subject: [PATCH] add confirmation dialog for sending LBC --- app/src/component/walletSend/view.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/component/walletSend/view.js b/app/src/component/walletSend/view.js index 5df634ab..7e79d152 100644 --- a/app/src/component/walletSend/view.js +++ b/app/src/component/walletSend/view.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import { regexAddress } from 'lbry-redux'; -import { TextInput, Text, View } from 'react-native'; +import { Alert, TextInput, Text, View } from 'react-native'; import Button from '../button'; import walletStyle from '../../styles/wallet'; @@ -52,8 +52,17 @@ class WalletSend extends React.PureComponent { } if (amount && address) { - sendToAddress(address, parseFloat(amount)); - this.setState({ address: null, amount: null }); + // Show confirmation before send + Alert.alert( + 'Send LBC', + `Are you sure you want to send ${amount} LBC to ${address}?`, + [ + { text: 'No' }, + { text: 'Yes', onPress: () => { + sendToAddress(address, parseFloat(amount)); + this.setState({ address: null, amount: null }); + }} + ]); } }