mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #947
This commit is contained in:
@@ -74,6 +74,9 @@ internal partial class WebViewer : UserControl, IRecipient<UserChangedMessage>
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: replace with .NET 8 UnsafeAccessor
|
||||
try
|
||||
{
|
||||
CoreWebView2 coreWebView2 = WebView.CoreWebView2;
|
||||
|
||||
if (SourceProvider is not null)
|
||||
@@ -92,10 +95,8 @@ internal partial class WebViewer : UserControl, IRecipient<UserChangedMessage>
|
||||
jsInterface = serviceProvider.CreateInstance<MiHoYoJSInterface>(coreWebView2, userAndUid);
|
||||
|
||||
CoreWebView2Navigator navigator = new(coreWebView2);
|
||||
await navigator.NavigateAsync("about:blank");
|
||||
Debug.WriteLine($"Before {source}");
|
||||
await navigator.NavigateAsync(source);
|
||||
Debug.WriteLine($"After {WebView.Source}");
|
||||
await navigator.NavigateAsync("about:blank").ConfigureAwait(true);
|
||||
await navigator.NavigateAsync(source).ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -104,4 +105,8 @@ internal partial class WebViewer : UserControl, IRecipient<UserChangedMessage>
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user