Skip to content

Commit

Permalink
refactor: Address IDE1006
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinguin2001 committed Jan 4, 2025
1 parent c3aed0d commit 12865f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Core/WebView2ProfileDataHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ public static class WebView2ProfileDataHelper
{
public static async Task ClearAllProfileDataAsync()
{
if (MainPageContent.mainWebView.CoreWebView2 != null) {
CoreWebView2Profile profile = MainPageContent.mainWebView.CoreWebView2.Profile;
if (MainPageContent.MainWebView.CoreWebView2 != null) {
CoreWebView2Profile profile = MainPageContent.MainWebView.CoreWebView2.Profile;
await profile.ClearBrowsingDataAsync();
}
else
Expand Down
7 changes: 3 additions & 4 deletions src/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

public sealed partial class MainPage : Page
{
public muxc.WebView2 mainWebView { get; set; }
public muxc.WebView2 MainWebView { get; set; }

public MainPage()
{
this.InitializeComponent();
Window.Current.SetTitleBar(CustomDragRegion);
var coreWindow = CoreWindow.GetForCurrentThread();
coreWindow.KeyDown += CoreWindow_KeyDown;

InitWebView();
}

Expand All @@ -33,8 +32,8 @@ private async void InitWebView()
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
mainWebView = new muxc.WebView2();
await mainWebView.EnsureCoreWebView2Async();
MainWebView = new muxc.WebView2();
await MainWebView.EnsureCoreWebView2Async();
});
}
catch
Expand Down

0 comments on commit 12865f2

Please sign in to comment.