diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index e707445..40a85f3 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -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);