Dispatch WebView2 runtime toast notification on UI thread (#811)

This commit is contained in:
Burak Kaan Köse
2026-02-16 16:32:47 +01:00
committed by GitHub
parent fec49ce6f8
commit 05112d6a35
7 changed files with 73 additions and 1 deletions
@@ -0,0 +1,26 @@
using System;
using System.Threading.Tasks;
using Microsoft.Web.WebView2.Core;
using Serilog;
using Wino.Core.Domain.Interfaces;
namespace Wino.Mail.WinUI.Services;
public class WebView2RuntimeValidatorService : IWebView2RuntimeValidatorService
{
public Task<bool> IsRuntimeAvailableAsync()
{
try
{
var version = CoreWebView2Environment.GetAvailableBrowserVersionString();
var hasRuntime = !string.IsNullOrWhiteSpace(version);
return Task.FromResult(hasRuntime);
}
catch (Exception ex)
{
Log.Error(ex, "WebView2 runtime validation failed.");
return Task.FromResult(false);
}
}
}