mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
14 lines
409 B
C#
14 lines
409 B
C#
|
using Microsoft.JSInterop;
|
||
|
|
||
|
namespace BTCPayServer.Blazor
|
||
|
{
|
||
|
public static class BlazorExtensions
|
||
|
{
|
||
|
public static bool IsPreRendering(this IJSRuntime runtime)
|
||
|
{
|
||
|
// The peculiar thing in prerender is that Blazor circuit isn't yet created, so we can't use JSInterop
|
||
|
return !(bool)runtime.GetType().GetProperty("IsInitialized").GetValue(runtime);
|
||
|
}
|
||
|
}
|
||
|
}
|