1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Track telemetry pref changed event (#445)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-06-11 13:50:43 +03:00 committed by GitHub
parent 0888ad8c5d
commit 8e514df70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -122,7 +122,6 @@
id="checkbox-allow-telemetry" id="checkbox-allow-telemetry"
switch switch
v-model="preferences.allowTelemetry" v-model="preferences.allowTelemetry"
:disabled="licenceData && licenceData.status === 'valid'"
@input="onSave" @input="onSave"
> >
Allow telemetry & usage tracking Allow telemetry & usage tracking

View File

@ -47,6 +47,11 @@ export default new Vuex.Store({
this.commit("savePreferences", userStore.getPreferences()); this.commit("savePreferences", userStore.getPreferences());
}, },
savePreferences(state, prefs) { savePreferences(state, prefs) {
if (prefs.allowTelemetry) {
tracker.event("telemetry", "enabled")
} else {
tracker.event("telemetry", "disabled")
}
state.preferences = prefs; state.preferences = prefs;
userStore.setPreferences(prefs); userStore.setPreferences(prefs);
this.dispatch("destroyWebviews") this.dispatch("destroyWebviews")