diff --git a/CHANGELOG.md b/CHANGELOG.md index 623fa999..4c209697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ### Changelog -#### Version - 3.3.1.0 - TBA +#### Version - 3.4.0.0 - 11/19/2023 * Fixed `--outputPath` not being used for the CLI `compile` (thanks to @majcosta for fixing that) * Improved Log message for cases where low storage on the drive Wabbajack is installed on causes compiles to fail * **To list authors still compiling on Wabbajack 3.0.5.0:** @@ -11,6 +11,8 @@ * Updated Dependencies * LZ4 to version 1.3.7-beta * SharpZipLib to version 1.4.2 +* Fully upgraded to .NET 8.0 +* Fixed the WebView2 based browser window to no longer crash the application when closed #### Version - 3.3.0.1 - (Was only a Pre-Release) * Fixed Manual Downloading on NexusMods being blocked by a hidden cookie consent banner diff --git a/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs b/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs index 8ed363ce..2c21a320 100644 --- a/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs +++ b/Wabbajack.App.Wpf/UserIntervention/ManualDownloadHandler.cs @@ -27,5 +27,6 @@ public class ManualDownloadHandler : BrowserWindowViewModel var uri = await task; Intervention.Finish(uri); + await Task.Delay(5000, CancellationToken.None); } } \ No newline at end of file diff --git a/Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs b/Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs index d0aa4a4c..5daee154 100644 --- a/Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs +++ b/Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs @@ -120,20 +120,27 @@ public abstract class BrowserWindowViewModel : ViewModel while (_browser.CoreWebView2 == null) await Task.Delay(10, token); - _browser.CoreWebView2.DownloadStarting += (sender, args) => + EventHandler handler = null!; + + handler = (_, args) => { try { source.SetResult(new Uri(args.DownloadOperation.Uri)); + _browser.CoreWebView2.DownloadStarting -= handler; } catch (Exception) { - source.SetCanceled(); + source.SetCanceled(token); + _browser.CoreWebView2.DownloadStarting -= handler; } args.Cancel = true; args.Handled = true; }; + + _browser.CoreWebView2.DownloadStarting += handler; + Uri uri; while (true) @@ -184,7 +191,7 @@ public abstract class BrowserWindowViewModel : ViewModel catch (Exception) { source.SetCanceled(); - } + } }; await source.Task; diff --git a/Wabbajack.App.Wpf/Views/BrowserView.xaml.cs b/Wabbajack.App.Wpf/Views/BrowserView.xaml.cs index 3a88cb24..52a68d52 100644 --- a/Wabbajack.App.Wpf/Views/BrowserView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/BrowserView.xaml.cs @@ -1,4 +1,6 @@ +using System; using System.Windows.Controls; +using Microsoft.Web.WebView2.WinForms; using ReactiveUI; namespace Wabbajack.Views; diff --git a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs index 267de3b9..175de016 100644 --- a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs @@ -2,6 +2,7 @@ using System; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading; +using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using MahApps.Metro.Controls; @@ -57,7 +58,6 @@ public partial class BrowserWindow : MetroWindow .ContinueWith(_ => Dispatcher.Invoke(() => { Close(); - Browser.Dispose(); Browser = null; })); }