From d5544461b87d4127b8a4397239188e057a8780e9 Mon Sep 17 00:00:00 2001 From: Manuel Mayer Date: Sat, 12 Mar 2022 21:02:47 +0100 Subject: [PATCH] Fixed bug that prevented the Extension Store from load --- .../ExtensionsView/ExtensionStoreView.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs b/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs index f8f9f22e..d57c9b12 100644 --- a/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs +++ b/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs @@ -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; @@ -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; @@ -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());