Skip to content

Commit 794d140

Browse files
committed
Merge branch 'devop/matomo' of github.com:MyEtherWallet/MyEtherWallet into devop/seo-pages-setup
2 parents dad4249 + fcfdf04 commit 794d140

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

src/main/mainApp.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ export default {
6464
},
6565
mounted() {
6666
EventBus.$on('swapTxBroadcasted', hash => {
67-
this.trackSwap('swapTxBroadcasted', hash, this.network.type.name);
67+
this.trackSwap('swapTxBroadcasted', hash, this.network.type.chainID);
6868
});
6969
EventBus.$on('swapTxReceivedReceipt', hash => {
70-
this.trackSwap('swapTxReceivedReceipt', hash, this.network.type.name);
70+
this.trackSwap('swapTxReceivedReceipt', hash, this.network.type.chainID);
7171
});
7272
EventBus.$on('swapTxFailed', hash => {
7373
const passedHash = hash === '0x' ? 'no hash' : hash;
74-
this.trackSwap('swapTxFailed', passedHash, this.network.type.name);
74+
this.trackSwap('swapTxFailed', passedHash, this.network.type.chainID);
75+
});
76+
EventBus.$on('swapTxNotBroadcastedFailed', () => {
77+
this.trackSwap('swapTxNotBroadcastedFailed');
7578
});
7679
EventBus.$on(BUYSELL_EVENT, () => {
7780
this.openBuy();
@@ -119,6 +122,7 @@ export default {
119122
EventBus.$off('swapTxBroadcasted');
120123
EventBus.$off('swapTxReceivedReceipt');
121124
EventBus.$off('swapTxFailed');
125+
EventBus.$off('swapTxNotBroadcastedFailed');
122126
},
123127
methods: {
124128
...mapActions('global', ['setOnlineStatus']),

src/modules/confirmation/ModuleConfirmation.vue

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ export default {
730730
_this.trackSwap(
731731
'swapTxReceivedReceipt',
732732
hash,
733-
this.network.type.name
733+
this.network.type.chainID
734734
);
735735
}
736736
})
@@ -751,7 +751,7 @@ export default {
751751
_this.trackSwap(
752752
'swapTxBroadcasted',
753753
hash,
754-
this.network.type.name
754+
this.network.type.chainID
755755
);
756756
}
757757
_this.reset();
@@ -822,7 +822,7 @@ export default {
822822
this.trackSwap(
823823
'swapTransactionSuccessfullySent',
824824
param,
825-
this.network.type.name
825+
this.network.type.chainID
826826
);
827827
}
828828
},
@@ -836,7 +836,11 @@ export default {
836836
event
837837
.on('transactionHash', res => {
838838
if (this.isSwap) {
839-
this.trackSwap('swapTxBroadcasted', res, this.network.type.name);
839+
this.trackSwap(
840+
'swapTxBroadcasted',
841+
res,
842+
this.network.type.chainID
843+
);
840844
}
841845
this.showTxOverlay = false;
842846
this.showSuccess(res);
@@ -847,7 +851,7 @@ export default {
847851
this.trackSwap(
848852
'swapTxReceivedReceipt',
849853
hash,
850-
this.network.type.name
854+
this.network.type.chainID
851855
);
852856
}
853857
})
@@ -932,7 +936,7 @@ export default {
932936
this.trackSwap(
933937
'swapTxReceivedReceipt',
934938
hash,
935-
this.network.type.name
939+
this.network.type.chainID
936940
);
937941
}
938942
})
@@ -941,9 +945,7 @@ export default {
941945
if (this.rejectedError(e.message)) {
942946
this.trackSwap('swapTxRejected');
943947
throw new Error(e.message);
944-
}
945-
946-
if (i + 1 === this.unsignedTxArr.length) {
948+
} else {
947949
this.emitSwapTxFail(e);
948950
}
949951
}
@@ -987,12 +989,8 @@ export default {
987989
);
988990
},
989991
emitSwapTxFail(err) {
990-
const receipt =
991-
err.hasOwnProperty('receipt') &&
992-
err.receipt.hasOwnProperty('transactionHash')
993-
? err.receipt.transactionHash
994-
: '0x';
995-
this.trackSwap('swapTxFailed', receipt, this.network.type.name);
992+
const hash = err?.receipt?.transactionHash;
993+
this.trackSwap('swapTxFailed', hash, this.network.type.chainID);
996994
},
997995
btnAction() {
998996
if (this.isSwap) {

src/utils/web3-provider/methods/eth_sendTransaction.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default async ({ payload, store, requestManager }, res, next) => {
109109
* Checks whether confirmInfo is true
110110
* if true, assume transaction is a swap
111111
*/
112+
let txHash;
112113
EventBus.$emit(event, params, _response => {
113114
if (_response.rejected) {
114115
res(new Error('User rejected action'));
@@ -128,6 +129,7 @@ export default async ({ payload, store, requestManager }, res, next) => {
128129
}
129130
})
130131
.once('transactionHash', hash => {
132+
txHash = hash;
131133
if (store.state.wallet.instance !== null) {
132134
const isTesting = locStore.get('mew-testing');
133135
if (!isTesting) {
@@ -154,12 +156,7 @@ export default async ({ payload, store, requestManager }, res, next) => {
154156
})
155157
.on('error', err => {
156158
if (confirmInfo) {
157-
const receipt =
158-
err.hasOwnProperty('receipt') &&
159-
err.receipt.hasOwnProperty('transactionHash')
160-
? err.receipt.transactionHash
161-
: '0x';
162-
EventBus.$emit('swapTxFailed', receipt);
159+
EventBus.$emit('swapTxFailed', txHash);
163160
}
164161
res(err);
165162
});
@@ -168,10 +165,7 @@ export default async ({ payload, store, requestManager }, res, next) => {
168165
})
169166
.catch(e => {
170167
if (confirmInfo) {
171-
const receipt = e.hasOwnProperty('receipt')
172-
? e.receipt.transactionHash
173-
: '0x';
174-
EventBus.$emit('swapTxFailed', receipt);
168+
EventBus.$emit('swapTxNotBroadcastedFailed');
175169
}
176170
res(e);
177171
});

0 commit comments

Comments
 (0)