1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Bringing Google stats back - Reverting #3148 (#3204)

This commit is contained in:
Ivan Efimov 2023-01-06 17:05:34 -06:00 committed by GitHub
parent e0209c6b59
commit 8e7aa89ee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 745 additions and 30 deletions

View file

@ -6,6 +6,7 @@ import CryptoES from 'crypto-es';
const receiver = {
rateChartHeight: 117,
analyticsChanges: {},
needReboot: false,
elrsPassphraseEnabled: false,
};
@ -75,6 +76,8 @@ receiver.initialize = function (callback) {
MSP.send_message(MSPCodes.MSP_FEATURE_CONFIG, false, false, get_rc_data);
function process_html() {
self.analyticsChanges = {};
const featuresElement = $('.tab-receiver .features');
FC.FEATURE_CONFIG.features.generateElements(featuresElement);
@ -240,9 +243,12 @@ receiver.initialize = function (callback) {
serialRxSelectElement.change(function () {
const serialRxValue = parseInt($(this).val());
let newValue;
if (serialRxValue !== FC.RX_CONFIG.serialrx_provider) {
newValue = $(this).find('option:selected').text();
updateSaveButton(true);
}
tab.analyticsChanges['SerialRx'] = newValue;
FC.RX_CONFIG.serialrx_provider = serialRxValue;
});
@ -296,9 +302,12 @@ receiver.initialize = function (callback) {
spiRxElement.change(function () {
const value = parseInt($(this).val());
let newValue = undefined;
if (value !== FC.RX_CONFIG.rxSpiProtocol) {
newValue = $(this).find('option:selected').text();
updateSaveButton(true);
}
tab.analyticsChanges['SPIRXProtocol'] = newValue;
FC.RX_CONFIG.rxSpiProtocol = value;
});
@ -484,6 +493,9 @@ receiver.initialize = function (callback) {
}
}
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, tab.analyticsChanges, 'receiver');
tab.analyticsChanges = {};
MSP.send_message(MSPCodes.MSP_SET_RX_MAP, mspHelper.crunch(MSPCodes.MSP_SET_RX_MAP), false, save_rssi_config);
}