Skip to content

Commit

Permalink
Fixed bug that prevented the Extension Store from load
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed Mar 12, 2022
1 parent a1c8103 commit d554446
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SuchByte.MacroDeck.ExtensionStore;
using Microsoft.Web.WebView2.Core;
using SuchByte.MacroDeck.ExtensionStore;
using SuchByte.MacroDeck.GUI.Dialogs;
using SuchByte.MacroDeck.Logging;
using System;
Expand All @@ -7,6 +8,7 @@
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand All @@ -22,12 +24,20 @@ public partial class ExtensionStoreView : UserControl
public ExtensionStoreView()
{
InitializeComponent();

InitializeBrowser();
this.webView.SourceChanged += WebView_SourceChanged;
this.webView.NavigationStarting += WebView_NavigationStarting;
this.webView.NavigationCompleted += WebView_NavigationCompleted;
this.Load += ExtensionStoreView_Load;
}

private async void InitializeBrowser()
{
var env = await CoreWebView2Environment.CreateAsync(null, MacroDeck.UserDirectoryPath);
await webView.EnsureCoreWebView2Async(env);
}

private void WebView_NavigationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
{
SpinnerDialog.SetVisisble(false, FindForm());
Expand Down

0 comments on commit d554446

Please sign in to comment.