Skip to content

Commit

Permalink
Just a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Gilde committed Jan 13, 2025
1 parent 54bb47c commit 39c195f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ protected virtual Task OnJsOptionsChanged()
/// </summary>
public virtual async Task ImportModuleAndCreateJsAsync()
{
try
{
await JsRuntime.InitializeMudBlazorExtensionsCoreAsync();
}
catch (Exception)
{}
await JsRuntime.InitializeMudBlazorExtensionsCoreAsync();
var references = await JsRuntime.ImportModuleAndCreateJsAsync<T>(GetJsArguments());
JsReference = references.jsObjectReference;
ModuleReference = references.moduleReference;
Expand Down
33 changes: 19 additions & 14 deletions MudBlazor.Extensions/Helper/JsImportHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,29 @@ public static Task<IJSRuntime> InitializeMudBlazorExtensionsAsync(this IJSRuntim
/// </summary>
internal static async Task<IJSRuntime> InitializeMudBlazorExtensionsCoreAsync(this IJSRuntime runtime, bool force = false)
{
LegacyRuntimeReference ??= (runtime ??= GetJsRuntime());
if (force || !UseMinified || !await runtime.IsNamespaceAvailableAsync("MudBlazorExtensions"))
try
{
try
LegacyRuntimeReference ??= (runtime ??= GetJsRuntime());
if (force || !UseMinified || !await runtime.IsNamespaceAvailableAsync("MudBlazorExtensions"))
{
await runtime.ImportModuleBlazorJS(); // This is a workaround for using module in MAUI apps
try
{
await runtime.ImportModuleBlazorJS(); // This is a workaround for using module in MAUI apps
}
catch (Exception e)
{}

try
{
await ImportMainMudEx(runtime); // This is a workaround for using module in MAUI apps
}
catch (Exception e)
{}
}
catch (Exception e)
{}

try
{
await ImportMainMudEx(runtime); // This is a workaround for using module in MAUI apps
}
catch (Exception e)
{}
await LoadCssAsync(runtime, force);
}
await LoadCssAsync(runtime, force);
catch (Exception e)
{}
return runtime;
}

Expand Down

0 comments on commit 39c195f

Please sign in to comment.