Update campaign progress UI

This commit is contained in:
2025-11-05 16:00:52 +09:00
parent 20d2de5070
commit 785a1db668
5 changed files with 40 additions and 0 deletions

View File

@ -25,6 +25,8 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
public IManager.ManagerState State { get; protected set; } = IManager.ManagerState.Created;
public event Action<Campaign>? OnCampaignProgressStep;
public abstract Task ProcessAsync();
public async Task EndWithFailAsync(Exception e)
@ -45,6 +47,8 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
campaign.Step = step;
campaign.Progress = (step + 1) / StepCount;
await HeadquartersService.UpdateCampaignStepAndProgressAsync(context, campaign);
OnCampaignProgressStep?.Invoke(campaign);
}
}
}