From 55a3032b0a7d765799ac413211a727d2826e6dbe Mon Sep 17 00:00:00 2001 From: Yuriy Durov Date: Sun, 15 Sep 2024 19:25:33 +0400 Subject: [PATCH] Fix state generated after InitializeStateAsync not being persisted --- .../RenderStrategies/PersistentComponentRenderStrategy.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BitzArt.Blazor.State/RenderStrategies/PersistentComponentRenderStrategy.cs b/src/BitzArt.Blazor.State/RenderStrategies/PersistentComponentRenderStrategy.cs index 4ff9081..9bec637 100644 --- a/src/BitzArt.Blazor.State/RenderStrategies/PersistentComponentRenderStrategy.cs +++ b/src/BitzArt.Blazor.State/RenderStrategies/PersistentComponentRenderStrategy.cs @@ -22,6 +22,9 @@ protected override async Task RunInitAndSetParametersAsync() await SetupStateAsync(); await base.RunInitAndSetParametersAsync(); + + if (PersistentComponent.StateContainer is not null) + await PersistentComponent.StateContainer!.RefreshAsync(); } private async Task WaitForPageStateAsync() @@ -161,9 +164,6 @@ protected async Task InitializeStateAsync() await PersistentComponent.InitializeStateInternalAsync(); StateInitialized = true; - - if (PersistentComponent.StateContainer is not null) - await PersistentComponent.StateContainer!.RefreshAsync(); } internal override void BuildRenderTree(RenderTreeBuilder builder)