ContextWindow: Use EnsureContextRenewed() correctly
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user