[ImageResizer]Fix: Deleting an Image Resizer preset deletes the wrong preset (#38476)

* [ImageResizer]Fix: Deleting an Image Resizer preset deletes the wrong preset

* update the helper

* sort items
This commit is contained in:
leileizhang
2025-04-23 09:35:40 +08:00
committed by GitHub
parent 232e1b79bd
commit e8b02cd797
5 changed files with 74 additions and 7 deletions

View File

@@ -8,11 +8,12 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Text.Json.Serialization;
using ManagedCommon;
using Settings.UI.Library.Resources;
namespace Microsoft.PowerToys.Settings.UI.Library;
public partial class ImageSize : INotifyPropertyChanged
public partial class ImageSize : INotifyPropertyChanged, IHasId
{
public event PropertyChangedEventHandler PropertyChanged;

View File

@@ -67,6 +67,7 @@ public partial class ImageResizerViewModel : Observable
try
{
Settings = _settingsUtils.GetSettings<ImageResizerSettings>(ModuleName);
IdRecoveryHelper.RecoverInvalidIds(Settings.Properties.ImageresizerSizes.Value);
}
catch (Exception e)
{