Skip to content

Commit ace8bec

Browse files
authored
feat(templates): use RenderInfo.IsInteractive for prerender session detection in Boilerplate #10250 (#10251)
1 parent 32b9388 commit ace8bec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppComponentBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected CancellationToken CurrentCancellationToken
6565
}
6666
}
6767

68-
protected bool InPrerenderSession => AppPlatform.IsBlazorHybrid is false && JSRuntime.IsInitialized() is false;
68+
protected bool InPrerenderSession => AppPlatform.IsBlazorHybrid is false && RendererInfo.IsInteractive is false;
6969

7070
protected sealed override void OnInitialized()
7171
{

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected override async Task OnInitializedAsync()
4141
{
4242
try
4343
{
44-
var inPrerenderSession = jsRuntime.IsInitialized() is false;
44+
var inPrerenderSession = RendererInfo.IsInteractive is false;
4545
isOnline = await prerenderStateService.GetValue<bool?>(nameof(isOnline), async () => isOnline ?? inPrerenderSession is true ? true : null);
4646
// During pre-rendering, if any API calls are made, the `isOnline` value will be set
4747
// using PubSub's `ClientPubSubMessages.IS_ONLINE_CHANGED`, depending on the success

0 commit comments

Comments
 (0)