diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/FindMyMouseSettings.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/FindMyMouseSettings.cs index 2f714cce1d..cd65372cdd 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/FindMyMouseSettings.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/FindMyMouseSettings.cs @@ -9,7 +9,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class FindMyMouseSettings : BasePTModuleSettings, ISettingsConfig { - public const string ModuleName = "Find My Mouse"; + public const string ModuleName = "FindMyMouse"; [JsonPropertyName("properties")] public FindMyMouseProperties Properties { get; set; } diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/MouseUtilsPage.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/MouseUtilsPage.xaml.cs index ac09340026..83a525abd2 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/MouseUtilsPage.xaml.cs +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/MouseUtilsPage.xaml.cs @@ -14,6 +14,24 @@ namespace Microsoft.PowerToys.Settings.UI.Views public MouseUtilsPage() { + try + { + // By mistake, the first release of Find My Mouse was saving settings in two places at the same time. + // Delete the wrong path for Find My Mouse settings. + var tempSettingsUtils = new SettingsUtils(); + if (tempSettingsUtils.SettingsExists("Find My Mouse")) + { + var settingsFilePath = tempSettingsUtils.GetSettingsFilePath("Find My Mouse"); + System.IO.File.Delete(settingsFilePath); + tempSettingsUtils.DeleteSettings("Find My Mouse"); + } + } +#pragma warning disable CA1031 // Do not catch general exception types + catch (System.Exception) +#pragma warning restore CA1031 // Do not catch general exception types + { + } + var settingsUtils = new SettingsUtils(); ViewModel = new MouseUtilsViewModel(settingsUtils, SettingsRepository.GetInstance(settingsUtils), SettingsRepository.GetInstance(settingsUtils), SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage); DataContext = ViewModel;