ContextWindow: Use EnsureContextRenewed() correctly

This commit is contained in:
2026-03-16 22:58:04 +01:00
parent 0aefab5d63
commit cc018ded10
6 changed files with 12 additions and 22 deletions

View File

@@ -13,7 +13,7 @@ namespace Elwig.Windows {
set {
_lockContext = value;
if (!_lockContext && _renewPending) {
Dispatcher.BeginInvoke(async () => await RenewContext());
Dispatcher.BeginInvoke(async () => await EnsureContextRenewed());
}
}
}
@@ -36,7 +36,7 @@ namespace Elwig.Windows {
public async Task HintContextChange() {
_renewPending = true;
if (LockContext) return;
await RenewContext();
await EnsureContextRenewed();
}
protected async void OnLoaded(object? sender, RoutedEventArgs? evt) {
@@ -44,7 +44,7 @@ namespace Elwig.Windows {
await OnRenewContext(ctx);
}
protected async Task RenewContext() {
protected async Task EnsureContextRenewed() {
if (!_renewPending) return;
using var ctx = new AppDbContext();
await OnRenewContext(ctx);