From 77f662f67bc4541013aa2af32063cd602d3c3876 Mon Sep 17 00:00:00 2001 From: rmbgame Date: Sun, 6 Jun 2021 00:38:05 +0800 Subject: [PATCH] jumplist fix --- src/ST.Client.Desktop.Windows/UI/JumpLists.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ST.Client.Desktop.Windows/UI/JumpLists.cs b/src/ST.Client.Desktop.Windows/UI/JumpLists.cs index ab60dc4c4..54d7633b0 100644 --- a/src/ST.Client.Desktop.Windows/UI/JumpLists.cs +++ b/src/ST.Client.Desktop.Windows/UI/JumpLists.cs @@ -1,6 +1,7 @@ extern alias JumpLists; using JumpLists::System.Windows.Shell; using AvaloniaApplication = Avalonia.Application; +using System.Linq; namespace System.Application.UI { @@ -54,6 +55,11 @@ namespace System.Application.UI JumpList jumpList1 = JumpList.GetJumpList(AvaloniaApplication.Current); if (jumpList1 != null) { + var tk = jumpList1.JumpItems.FirstOrDefault(s => s is JumpTask t && t.Arguments == task.Arguments); + if (tk != null) + { + jumpList1.JumpItems.Remove(tk); + } jumpList1.JumpItems.Add(task); if (isRecent) JumpList.AddToRecentCategory(task);