1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

RF: Moved Analytics to class (#3222)

* RF: Moved Analytics to class

* Modularisation of Google analytics.

* Removing the code smells

* Fix the unit tests

* Simplified

* Removed comment
This commit is contained in:
J Blackman 2023-01-08 05:56:26 +11:00 committed by GitHub
parent 00075939ac
commit fd99e77335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 251 additions and 233 deletions

View file

@ -1,5 +1,6 @@
import { i18n } from '../localization';
import GUI from '../gui';
import { tracking } from "../Analytics";
const power = {
supported: false,
@ -11,8 +12,6 @@ power.initialize = function (callback) {
if (GUI.active_tab != 'power') {
GUI.active_tab = 'power';
// Disabled on merge into betaflight-configurator
//googleAnalytics.sendAppView('Power');
}
if (GUI.calibrationManager) {
@ -473,7 +472,7 @@ power.initialize = function (callback) {
FC.BATTERY_CONFIG.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val());
FC.BATTERY_CONFIG.capacity = parseInt($('input[name="capacity"]').val());
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'power');
tracking.sendSaveAndChangeEvents(tracking.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'power');
save_power_config();
});