fix background image switch crash

This commit is contained in:
Lightczx
2024-02-07 16:24:56 +08:00
parent 425b3789bf
commit a6c376cd44

View File

@@ -38,6 +38,7 @@ internal sealed partial class BackgroundImageService : IBackgroundImageService
string path = System.Random.Shared.GetItems(backgroundSet.ToArray(), 1)[0];
backgroundSet.Remove(path);
await taskContext.SwitchToMainThreadAsync();
if (string.Equals(path, previous?.ImageSource.UriSource.ToString(), StringComparison.OrdinalIgnoreCase))
{
return new(false, default!);