From 5b8df9d505195043df8a9059fb24beae7c30f342 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:31:41 +0200 Subject: [PATCH] fix: remove unnecessary _app.Invoke calls around update progress dialog updates --- src/EchoHub.Client/Services/UpdateChecker.cs | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/EchoHub.Client/Services/UpdateChecker.cs b/src/EchoHub.Client/Services/UpdateChecker.cs index 776736a..d8e43bc 100644 --- a/src/EchoHub.Client/Services/UpdateChecker.cs +++ b/src/EchoHub.Client/Services/UpdateChecker.cs @@ -71,7 +71,7 @@ public sealed class UpdateChecker : IDisposable // Create backup before the update starts try { - _app.Invoke(() => _progressDialog?.UpdateProgress(0f, "Creating backup...")); + _progressDialog?.UpdateProgress(0f, "Creating backup..."); UpdateBackupService.CreateBackup(); } catch (Exception ex) @@ -79,27 +79,21 @@ public sealed class UpdateChecker : IDisposable Log.Error(ex, "Failed to create pre-update backup"); var proceed = false; - _app.Invoke(() => - { - proceed = MessageBox.Query( - _app, - "Backup Warning", - $"Could not create backup: {ex.Message}\n\nContinue update without backup?", - "Continue", "Cancel") == 0; - }); + proceed = MessageBox.Query( + _app, + "Backup Warning", + $"Could not create backup: {ex.Message}\n\nContinue update without backup?", + "Continue", "Cancel") == 0; if (!proceed) { - _app.Invoke(() => - { - _progressDialog?.Close(); - _progressDialog = null; - }); + _progressDialog?.Close(); + _progressDialog = null; return; } } - _app.Invoke(() => _progressDialog?.UpdateProgress(0f, "Downloading update...")); + _progressDialog?.UpdateProgress(0f, "Downloading update..."); await _updater.UpdateAsync(); }); @@ -118,7 +112,7 @@ public sealed class UpdateChecker : IDisposable statusText = $"{step}..."; } - _app.Invoke(() => _progressDialog?.UpdateProgress(fraction, statusText)); + _progressDialog?.UpdateProgress(fraction, statusText); } private void OnUpdateStarted(string version)