Skip to content

Commit 3743574

Browse files
committed
fix: update condition for creating vault matomo event
1 parent 40f7c68 commit 3743574

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

features/create-vault/create-vault-form/use-create-vault.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const useCreateVault = () => {
4848
value,
4949
};
5050

51-
const success = await withSuccess(
51+
const result = await withSuccess(
5252
sendTX({
5353
transactions: [tx],
5454
mainActionCompleteText: vaultTexts.actions.createVault.completed,
@@ -57,13 +57,15 @@ export const useCreateVault = () => {
5757
}),
5858
);
5959

60-
trackEvent(
61-
...MATOMO_CLICK_EVENTS[
62-
MATOMO_CLICK_EVENTS_TYPES.finalisingCreatingVault
63-
],
64-
);
60+
if (result.success) {
61+
trackEvent(
62+
...MATOMO_CLICK_EVENTS[
63+
MATOMO_CLICK_EVENTS_TYPES.finalisingCreatingVault
64+
],
65+
);
66+
}
6567

66-
return success;
68+
return result;
6769
},
6870
[chainId, sendTX],
6971
),

0 commit comments

Comments
 (0)