fix dailynote refresh time notify

This commit is contained in:
DismissedLight
2023-08-26 00:14:18 +08:00
parent 020c8c38a8
commit 0de4aff03a
5 changed files with 23 additions and 6 deletions

View File

@@ -136,6 +136,6 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
OnPropertyChanged(nameof(DailyNote));
RefreshTime = DateTimeOffset.Now;
OnPropertyChanged(nameof(RefreshTime));
OnPropertyChanged(nameof(RefreshTimeFormatted));
}
}

View File

@@ -2643,6 +2643,15 @@ namespace Snap.Hutao.Resource.Localization {
}
}
/// <summary>
/// 查找类似 正在获取实时便笺信息,请稍候 的本地化字符串。
/// </summary>
internal static string ViewModelDailyNoteRequestProgressTitle {
get {
return ResourceManager.GetString("ViewModelDailyNoteRequestProgressTitle", resourceCulture);
}
}
/// <summary>
/// 查找类似 成功保存到指定位置 的本地化字符串。
/// </summary>

View File

@@ -1034,6 +1034,9 @@
<data name="ViewModelDailyNoteRegisterTaskFail" xml:space="preserve">
<value>注册计划任务失败,请使用管理员模式重试</value>
</data>
<data name="ViewModelDailyNoteRequestProgressTitle" xml:space="preserve">
<value>正在获取实时便笺信息,请稍候</value>
</data>
<data name="ViewModelExportSuccessMessage" xml:space="preserve">
<value>成功保存到指定位置</value>
</data>

View File

@@ -255,10 +255,6 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.30">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="17.6.11" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.18-beta">
<PrivateAssets>all</PrivateAssets>

View File

@@ -1,6 +1,8 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control.Extension;
using Snap.Hutao.Core;
using Snap.Hutao.Factory.Abstraction;
using Snap.Hutao.Model.Entity;
@@ -89,7 +91,14 @@ internal sealed partial class DailyNoteViewModel : Abstraction.ViewModel
{
if (userAndUid is not null)
{
await dailyNoteService.AddDailyNoteAsync(userAndUid).ConfigureAwait(false);
ContentDialog dialog = await contentDialogFactory
.CreateForIndeterminateProgressAsync(SH.ViewModelDailyNoteRequestProgressTitle)
.ConfigureAwait(false);
using (await dialog.BlockAsync(taskContext).ConfigureAwait(false))
{
await dailyNoteService.AddDailyNoteAsync(userAndUid).ConfigureAwait(false);
}
}
}