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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: replace with .NET 8 UnsafeAccessor
|
||||||
|
try
|
||||||
|
{
|
||||||
CoreWebView2 coreWebView2 = WebView.CoreWebView2;
|
CoreWebView2 coreWebView2 = WebView.CoreWebView2;
|
||||||
|
|
||||||
if (SourceProvider is not null)
|
if (SourceProvider is not null)
|
||||||
@@ -92,10 +95,8 @@ internal partial class WebViewer : UserControl, IRecipient<UserChangedMessage>
|
|||||||
jsInterface = serviceProvider.CreateInstance<MiHoYoJSInterface>(coreWebView2, userAndUid);
|
jsInterface = serviceProvider.CreateInstance<MiHoYoJSInterface>(coreWebView2, userAndUid);
|
||||||
|
|
||||||
CoreWebView2Navigator navigator = new(coreWebView2);
|
CoreWebView2Navigator navigator = new(coreWebView2);
|
||||||
await navigator.NavigateAsync("about:blank");
|
await navigator.NavigateAsync("about:blank").ConfigureAwait(true);
|
||||||
Debug.WriteLine($"Before {source}");
|
await navigator.NavigateAsync(source).ConfigureAwait(true);
|
||||||
await navigator.NavigateAsync(source);
|
|
||||||
Debug.WriteLine($"After {WebView.Source}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -104,4 +105,8 @@ internal partial class WebViewer : UserControl, IRecipient<UserChangedMessage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (ObjectDisposedException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user