1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-02 14:47:55 +02:00

Fix MM-35819 for Windows

This commit is contained in:
Chen-I Lim 2021-05-24 16:06:47 -07:00
parent 4b3de6552b
commit 898ed4a6a5

View File

@ -134,7 +134,7 @@ namespace Focalboard {
webView.ContentLoading += WebView_ContentLoading; webView.ContentLoading += WebView_ContentLoading;
var url = String.Format("http://localhost:{0}", port); var url = String.Format("http://localhost:{0}/", port);
webView.Source = new Uri(url); webView.Source = new Uri(url);
} }
@ -146,7 +146,10 @@ namespace Focalboard {
private void WebView_ContentLoading(object sender, CoreWebView2ContentLoadingEventArgs e) { private void WebView_ContentLoading(object sender, CoreWebView2ContentLoadingEventArgs e) {
// Set focalboardSessionId // Set focalboardSessionId
string script = $"localStorage.setItem('focalboardSessionId', '{sessionToken}');"; var url = String.Format("http://localhost:{0}/", port);
string script = $@"if (window.location.href.toLowerCase().startsWith('{url}'.toLowerCase())) {{
localStorage.setItem('focalboardSessionId', '{sessionToken}');
}}";
webView.ExecuteScriptAsync(script); webView.ExecuteScriptAsync(script);
} }
} }