Jonathan Rainville 42a9530452
feat(metrics): add onboarding screen metrics and section navigation (#16112) (#16145)
* feat(metrics): add onboarding screen metrics and section navigation

Fixes #16100

Adds metrics for navigating to the different screens of the onboarding and when navigating to a new section while logged in; only when enabled of course.

I refactored the code a little to make it simpler. I moved the check to see if the metrics collection is enabled in the async task itself, so we don't have to check it each time we add a new metric

* fix metric sent from module

* review comments

* add flowtype
2024-08-19 12:52:17 -04:00

17 lines
482 B
QML

import QtQml 2.15
QtObject {
id: root
function toggleCentralizedMetrics(enabled) {
metrics.toggleCentralizedMetrics(enabled)
}
function addCentralizedMetricIfEnabled(eventName, eventValue = null) {
let eventValueJsonStr = !!eventValue ? JSON.stringify(eventValue) : ""
metrics.addCentralizedMetricIfEnabled(eventName, eventValueJsonStr)
}
readonly property bool isCentralizedMetricsEnabled : metrics.isCentralizedMetricsEnabled
}