Checks GitHub for a newer version. If found, shows an inline banner with changelog and Update/Skip buttons.
()
| 141 | /// with changelog and Update/Skip buttons. |
| 142 | /// </summary> |
| 143 | private async Task CheckForAutoUpdateAsync() |
| 144 | { |
| 145 | try |
| 146 | { |
| 147 | var result = await Services.AppUpdater.CheckAsync(); |
| 148 | if (result == null || !result.UpdateAvailable || result.DownloadUrl == null) |
| 149 | return; |
| 150 | |
| 151 | _pendingUpdate = result; |
| 152 | var versionStr = result.TagName?.TrimStart('v') ?? result.TagName ?? "unknown"; |
| 153 | var body = result.Body?.Trim() ?? ""; |
| 154 | |
| 155 | UpdateBannerTitle.Text = $"Update available - v{versionStr}"; |
| 156 | UpdateBannerStatus.Text = "A new version of CloudRedirect is ready to install."; |
| 157 | |
| 158 | if (!string.IsNullOrEmpty(body)) |
| 159 | { |
| 160 | UpdateChangelogText.Text = body; |
| 161 | UpdateChangelogScroll.Visibility = Visibility.Visible; |
| 162 | } |
| 163 | |
| 164 | if (!string.IsNullOrEmpty(result.HtmlUrl)) |
| 165 | UpdateReleaseNotesButton.Visibility = Visibility.Visible; |
| 166 | |
| 167 | AppUpdateAvailable = true; |
| 168 | UpdateBanner.Visibility = Visibility.Visible; |
| 169 | } |
| 170 | catch |
| 171 | { |
| 172 | // Auto-update check failures are non-fatal |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | private async void UpdateNow_Click(object sender, RoutedEventArgs e) |
| 177 | { |
nothing calls this directly
no test coverage detected