diff --git a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs index 2031ed53..8304f4b0 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs @@ -69,6 +69,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi using (activateSemaphore.Enter()) { // TODO: Introduced in 1.10.2, remove in later version + serviceProvider.GetRequiredService().ClearAsync().SafeForget(); serviceProvider.GetRequiredService().UnregisterAllTasks(); if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed) diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs b/src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs new file mode 100644 index 00000000..4750203f --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs @@ -0,0 +1,9 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +namespace Snap.Hutao.Core.Shell; + +internal interface IJumpListInterop +{ + ValueTask ClearAsync(); +} \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs b/src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs new file mode 100644 index 00000000..2a52b787 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs @@ -0,0 +1,22 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +using Windows.UI.StartScreen; + +namespace Snap.Hutao.Core.Shell; + +[Injection(InjectAs.Transient, typeof(IJumpListInterop))] +internal sealed class JumpListInterop : IJumpListInterop +{ + public async ValueTask ClearAsync() + { + if (JumpList.IsSupported()) + { + JumpList list = await JumpList.LoadCurrentAsync(); + + list.Items.Clear(); + + await list.SaveAsync(); + } + } +} \ No newline at end of file