DeliveryAdminWindow: Fix creation of new deliveries
All checks were successful
Test / Run tests (push) Successful in 2m2s

This commit is contained in:
2026-04-02 20:56:08 +02:00
parent e593175e72
commit f96ebdcf60
5 changed files with 34 additions and 29 deletions

View File

@@ -30,11 +30,19 @@ namespace Elwig.Windows {
}
public async void ForceContextReload(object sender, EventArgs evt) {
await HintContextChange();
await ForceContextReload();
}
public async Task HintContextChange() {
public async Task ForceContextReload() {
HintContextChange();
await TryContextReload();
}
public void HintContextChange() {
_renewPending = true;
}
public async Task TryContextReload() {
if (LockContext) return;
await EnsureContextRenewed();
}
@@ -49,9 +57,9 @@ namespace Elwig.Windows {
protected async Task EnsureContextRenewed() {
if (!_renewPending) return;
_renewPending = false;
using var ctx = new AppDbContext();
await OnRenewContext(ctx);
_renewPending = false;
}
virtual protected async Task OnInit(AppDbContext ctx) { }