[New+]Fix call enabled telemetry event (#35236)

This commit is contained in:
Jaime Bernardo 2024-10-03 15:08:28 +01:00 committed by GitHub
parent 6d69a79c75
commit bcb5ce895c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,6 +91,9 @@ public:
{
Logger::info("New+ enabled via Settings UI");
// Log telemetry
Trace::EventToggleOnOff(true);
newplus::utilities::register_msix_package();
powertoy_new_enabled = true;
@ -99,8 +102,7 @@ public:
virtual void disable() override
{
Logger::info("New+ disabled via Settings UI");
powertoy_new_enabled = false;
Disable(true);
}
virtual bool is_enabled() override
@ -125,12 +127,23 @@ public:
virtual void destroy() override
{
Disable(false);
delete this;
}
private:
bool powertoy_new_enabled = false;
void Disable(bool const traceEvent)
{
// Log telemetry
if (traceEvent)
{
Trace::EventToggleOnOff(false);
}
powertoy_new_enabled = false;
}
void init_settings()
{
powertoy_new_enabled = NewSettingsInstance().GetEnabled();