From 160ae209b252c6b439ec44db88cb96a1e342df27 Mon Sep 17 00:00:00 2001
From: Boris Kubiak
Date: Fri, 16 Oct 2020 16:41:36 +0200
Subject: [PATCH] Improve events
---
src/App.vue | 6 ++++++
src/vue/Description.vue | 3 ++-
src/vue/Input.vue | 6 ++++--
src/vue/Save.vue | 1 +
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 9af16eb..9322289 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -251,6 +251,12 @@
this.countCores();
this.initWorkers();
window['benchmark'] = this.benchmark;
+
+ this.$root.$on('event', (name) => {
+ if (window['umami']) {
+ window['umami'].trackEvent(name, 'click');
+ }
+ });
}
};
diff --git a/src/vue/Description.vue b/src/vue/Description.vue
index 296e25c..f91e807 100644
--- a/src/vue/Description.vue
+++ b/src/vue/Description.vue
@@ -5,7 +5,7 @@
Enter a short prefix/suffix of your choice, and click ‘generate’ to start.
-
+
What's a vanity address?
@@ -66,6 +66,7 @@
methods: {
scrollDown() {
this.scrollTo(document.getElementById('input-panel'), -1);
+ this.$root.$emit('event', 'Start now');
},
scrollTo(element, lastValue) {
let currentValue = window.scrollY;
diff --git a/src/vue/Input.vue b/src/vue/Input.vue
index 754da65..1604efc 100644
--- a/src/vue/Input.vue
+++ b/src/vue/Input.vue
@@ -48,11 +48,11 @@
@@ -106,10 +106,12 @@
startGen: function () {
if (!this.running && !this.inputError && !this.error) {
this.$emit('start');
+ this.$root.$emit('event', 'Generate');
}
},
stopGen: function () {
this.$emit('stop');
+ this.$root.$emit('event', 'Stop');
}
},
watch: {
diff --git a/src/vue/Save.vue b/src/vue/Save.vue
index a8e2730..c8c3db7 100644
--- a/src/vue/Save.vue
+++ b/src/vue/Save.vue
@@ -44,6 +44,7 @@
save() {
if (this.password) {
this.loading = true;
+ this.$root.$emit('event', 'Download');
setTimeout(() => {
const wallet = this.generateWallet(this.privateKey, this.password);