Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RenderInfo.IsInteractive instead of internal reflection in Boilerplate (#10250) #10251

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected CancellationToken CurrentCancellationToken
}
}

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

protected sealed override void OnInitialized()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected override async Task OnInitializedAsync()
{
try
{
var inPrerenderSession = jsRuntime.IsInitialized() is false;
var inPrerenderSession = RendererInfo.IsInteractive is false;
isOnline = await prerenderStateService.GetValue<bool?>(nameof(isOnline), async () => isOnline ?? inPrerenderSession is true ? true : null);
// During pre-rendering, if any API calls are made, the `isOnline` value will be set
// using PubSub's `ClientPubSubMessages.IS_ONLINE_CHANGED`, depending on the success
Expand Down
Loading