Bugfix: Only continue on refresh timer if ui Update has been completed

This commit is contained in:
Daniel Schick 2024-05-13 17:18:47 +02:00
parent fe2499707d
commit cc743cd602

View File

@ -505,6 +505,11 @@ namespace BreCalClient
try
{
double interval = (double) SHIPCALL_UPDATE_INTERVAL_SECONDS / PROGRESS_STEPS;
if (Interlocked.CompareExchange(ref _uiUpdateRunning, 1, 0) == 1) // do not restart progress unless UI update has completed
await Task.Delay(TimeSpan.FromSeconds(interval));
System.Diagnostics.Trace.WriteLine("restarting refresh countdown");
for (int i = 0; i < PROGRESS_STEPS; i++)
{
await Task.Delay(TimeSpan.FromSeconds(interval), _tokenSource.Token);