MainWindow: Add feedback for users when App.CheckForUpdates finds no updates

This commit is contained in:
2024-04-06 17:35:30 +02:00
parent 9062d55b20
commit c360e6b6a7
2 changed files with 6 additions and 3 deletions

View File

@ -212,11 +212,11 @@ namespace Elwig {
if (w is UpdateDialog) return;
}
if (Utils.HasInternetConnectivity()) {
Utils.RunBackground("Auto Updater", CheckForUpdates);
Utils.RunBackground("Auto Updater", async () => await CheckForUpdates());
}
}
public static async Task CheckForUpdates() {
public static async Task CheckForUpdates(bool showSuccess = false) {
if (Config.UpdateUrl == null) return;
var latest = await Utils.GetLatestInstallerUrl(Config.UpdateUrl);
if (latest != null && new Version(latest.Value.Version) > new Version(Version)) {
@ -227,6 +227,9 @@ namespace Elwig {
Current.Shutdown();
}
});
} else if (showSuccess) {
MessageBox.Show("Elwig ist auf dem aktuellsten Stand!", "Nach Updates suchen",
MessageBoxButton.OK, MessageBoxImage.Information);
}
}

View File

@ -41,7 +41,7 @@ namespace Elwig.Windows {
}
private async void Menu_Help_Update_Click(object sender, RoutedEventArgs evt) {
await App.CheckForUpdates();
await App.CheckForUpdates(true);
}
private async void Menu_Help_Smtp_Click(object sender, RoutedEventArgs evt) {