Skip to content

Commit

Permalink
[Blazor] Call .NET from JS - OperatingSystem.IsBrowser() (#33846)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr authored Oct 14, 2024
1 parent f679e7e commit 0965570
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ In the following `GenericsExample` component:

```razor
@page "/generics-example"
@using System.Runtime.InteropServices
@implements IDisposable
@inject IJSRuntime JS
Expand All @@ -813,8 +812,7 @@ In the following `GenericsExample` component:
public async Task InvokeInterop()
{
var syncInterop =
RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"));
var syncInterop = OperatingSystem.IsBrowser();
await JS.InvokeVoidAsync(
"invokeMethodsAsync", syncInterop, objRef1, objRef2);
Expand All @@ -834,7 +832,6 @@ In the following `GenericsExample` component:

```razor
@page "/generics-example"
@using System.Runtime.InteropServices
@implements IDisposable
@inject IJSRuntime JS
Expand All @@ -861,8 +858,7 @@ In the following `GenericsExample` component:
public async Task InvokeInterop()
{
var syncInterop =
RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"));
var syncInterop = OperatingSystem.IsBrowser();
await JS.InvokeVoidAsync(
"invokeMethodsAsync", syncInterop, objRef1, objRef2);
Expand Down

0 comments on commit 0965570

Please sign in to comment.