Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into master-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Nov 13, 2024
2 parents fc2900e + c5f9490 commit 8fa8297
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
- name: Validate Deployment Tool Attestation
working-directory: ${{ steps.deploytool.outputs.home }}
run: gh attestation verify DragonFruit.OnionFruit.Deploy.dll --repo dragonfruitnetwork/onionfruit-deploy --deny-self-hosted-runners
env:
GH_TOKEN: ${{ github.token }}

- name: Restore .NET Tools
run: dotnet tool restore
Expand Down
11 changes: 10 additions & 1 deletion DragonFruit.OnionFruit/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using LucideAvalonia.Enum;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Nito.AsyncEx;
using ReactiveUI;

Expand Down Expand Up @@ -254,7 +255,15 @@ public static bool Launch(string url)
UseShellExecute = true
};

return Process.Start(psi) != null;
try
{
return Process.Start(psi) != null;
}
catch (Exception e)
{
Instance.Services.GetRequiredService<ILogger<App>>().LogWarning(e, "Failed to launch URL due to an error: {err}", e.Message);
return false;
}
}

public static IconSource GetIcon(LucideIconNames icon, IImmutableSolidColorBrush brush = null, double thickness = 1.5)
Expand Down
2 changes: 1 addition & 1 deletion DragonFruit.OnionFruit/Updater/VelopackUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private async Task PerformUpdateCheckInternal()
}
catch (Exception e)
{
_logger.LogError(e, "Failed to perform updater: {message}", e.Message);
_logger.LogError(e, "Failed to perform update: {message}", e.Message);
Status = OnionFruitUpdaterStatus.Failed;
}
}
Expand Down
4 changes: 2 additions & 2 deletions DragonFruit.OnionFruit/ViewModels/AboutPageTabViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public AboutPageTabViewModel(IOnionFruitUpdater updater, ILogger<AboutPageTabVie
{
OnionFruitUpdaterStatus.Checking => "Checking for updates...",

OnionFruitUpdaterStatus.Downloading when x.Second.HasValue => $"Downloading update ({x.Second}%)",
OnionFruitUpdaterStatus.Downloading when x.Second.HasValue => $"Downloading ({x.Second}%)",
OnionFruitUpdaterStatus.Failed when x.Second.HasValue => "Update failed",

OnionFruitUpdaterStatus.Downloading => "Downloading update...",
OnionFruitUpdaterStatus.Downloading => "Downloading...",
OnionFruitUpdaterStatus.Failed => "Update check failed",

OnionFruitUpdaterStatus.UpToDate => "No updates available",
Expand Down
8 changes: 4 additions & 4 deletions DragonFruit.OnionFruit/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ private static IEnumerable<TorNodeCountry> ProcessCountries(EventPattern<IReadOn

private static string GetWindowTitle((OnionFruitUpdaterStatus Status, int? Progress) current) => current.Status switch
{
OnionFruitUpdaterStatus.Downloading when current.Progress.HasValue => $"{App.Title} - Downloading update ({current.Progress}%)",
OnionFruitUpdaterStatus.Downloading => $"{App.Title} - Downloading update",
OnionFruitUpdaterStatus.PendingRestart => $"{App.Title} - Update downloaded (pending restart)",
OnionFruitUpdaterStatus.Failed => $"{App.Title} - Update failed",
OnionFruitUpdaterStatus.Downloading when current.Progress.HasValue => $"{App.Title} - Downloading Update ({current.Progress}%)",
OnionFruitUpdaterStatus.Downloading => $"{App.Title} - Downloading Update",
OnionFruitUpdaterStatus.PendingRestart => $"{App.Title} - Update Downloaded",
OnionFruitUpdaterStatus.Failed => $"{App.Title} - Update Failed",

_ => App.Title
};
Expand Down

0 comments on commit 8fa8297

Please sign in to comment.