mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Merge pull request #1645 from DGP-Studio/fix/jumplist
This commit is contained in:
@@ -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<IJumpListInterop>().ClearAsync().SafeForget();
|
||||
serviceProvider.GetRequiredService<IScheduleTaskInterop>().UnregisterAllTasks();
|
||||
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed)
|
||||
|
||||
9
src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs
Normal file
9
src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs
Normal file
@@ -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();
|
||||
}
|
||||
22
src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs
Normal file
22
src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user