Browse Source

Catch notification errors from upstream Uwp issue

pull/5/head
Ionite 1 year ago
parent
commit
68a8461a77
No known key found for this signature in database
  1. 18
      StabilityMatrix/ViewModels/LaunchViewModel.cs

18
StabilityMatrix/ViewModels/LaunchViewModel.cs

@ -226,10 +226,20 @@ public partial class LaunchViewModel : ObservableObject
{
webUiUrl = url;
ShowWebUiButton = true;
new ToastContentBuilder()
.AddText("Stable Diffusion Web UI ready to go!")
.AddButton("Open Web UI", ToastActivationType.Foreground, url)
.Show();
// Uwp toasts has upstream issues on some machines
// https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/4858
try
{
new ToastContentBuilder()
.AddText("Stable Diffusion Web UI ready to go!")
.AddButton("Open Web UI", ToastActivationType.Foreground, url)
.Show();
}
catch (Exception e)
{
logger.LogWarning("Failed to show Windows notification: {Message}", e.Message);
}
}
public void OnLoaded()

Loading…
Cancel
Save