From 9eb18fc739dadd33c7ce1bfa35d4504ff1b6ad33 Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Thu, 3 Oct 2024 14:06:43 +0100 Subject: [PATCH] [New+]Fix call enabled telemetry event --- .../powertoys_module.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/modules/NewPlus/NewShellExtensionContextMenu/powertoys_module.cpp b/src/modules/NewPlus/NewShellExtensionContextMenu/powertoys_module.cpp index 2e6dccfdee..303f072e3b 100644 --- a/src/modules/NewPlus/NewShellExtensionContextMenu/powertoys_module.cpp +++ b/src/modules/NewPlus/NewShellExtensionContextMenu/powertoys_module.cpp @@ -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();