Skip to content

Commit

Permalink
Fix on TxStore
Browse files Browse the repository at this point in the history
  • Loading branch information
patitonar committed Mar 27, 2019
1 parent bafe844 commit d42b6c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/stores/TxStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ class TxStore {
addPendingTransaction()
this.getTxReceipt(hash)
}).on('error', (e) => {
if(!e.message.includes('not mined within 50 blocks') && !e.message.includes('Failed to subscribe to new newBlockHeaders')){
console.log(e.message)
if(e.message.includes('User denied transaction signature')) {
this.alertStore.setLoading(false)
this.alertStore.pushError('Transaction rejected on wallet');
} else if(!e.message.includes('not mined within 50 blocks') && !e.message.includes('Failed to subscribe to new newBlockHeaders')){
// False error is thrown by web3 https://github.com/ethereum/web3.js/issues/2542
// this.alertStore.setLoading(false)
// this.alertStore.pushError('Transaction rejected on wallet');
Expand Down Expand Up @@ -107,7 +111,7 @@ class TxStore {
web3.eth.getTransactionReceipt(hash, (error, res) => {
if(res && res.blockNumber){
if(this.isStatusSuccess(res)){
if(this.web3Store.metamaskNet.id === this.web3Store.homeNet.id.toString()) {
if(this.web3Store.metamaskNet.id === this.web3Store.homeNet.id) {
const blockConfirmations = this.homeStore.latestBlockNumber - res.blockNumber
if(blockConfirmations >= 8) {
this.alertStore.setBlockConfirmations(8)
Expand Down

0 comments on commit d42b6c6

Please sign in to comment.