Skip to content
Merged
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
10 changes: 5 additions & 5 deletions aspnetcore/blazor/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ else
{
var result = await ProtectedSessionStore.GetAsync<int>("count");
CurrentCount = result.Success ? result.Value : 0;
isConnected = true;
isLoaded = true;
}

public async Task IncrementCount()
Expand All @@ -469,7 +469,7 @@ else
@using Microsoft.AspNetCore.ProtectedBrowserStorage
@inject ProtectedSessionStorage ProtectedSessionStore

@if (isConnected)
@if (isLoaded)
{
<CascadingValue Value="this">
@ChildContent
Expand All @@ -481,7 +481,7 @@ else
}

@code {
private bool isConnected;
private bool isLoaded;

[Parameter]
public RenderFragment ChildContent { get; set; }
Expand All @@ -492,7 +492,7 @@ else
{
if (firstRender)
{
isConnected = true;
isLoaded = true;
await LoadStateAsync();
StateHasChanged();
}
Expand All @@ -501,7 +501,7 @@ else
private async Task LoadStateAsync()
{
CurrentCount = await ProtectedSessionStore.GetAsync<int>("count");
isConnected = true;
isLoaded = true;
}

public async Task IncrementCount()
Expand Down
Loading