From 248b31e0fb9748fe08005a1c826470ee9ee409bd Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 29 Mar 2020 15:20:59 -0700 Subject: [PATCH] Load satellite resources before rendering components --- .../WebAssembly/src/Hosting/WebAssemblyHost.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs b/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs index 4b3114b506..68519c1fd8 100644 --- a/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs +++ b/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs @@ -120,6 +120,10 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting _started = true; + // Users may want to configure the culture based on some ambient state such as local storage, url etc. + // If they have changed the culture since the initial load, fetch satellite assemblies for this selection. + await SatelliteResourcesLoader.LoadCurrentCultureResourcesAsync(); + var tcs = new TaskCompletionSource(); using (cancellationToken.Register(() => { tcs.TrySetResult(null); })) @@ -134,10 +138,6 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting await _renderer.AddComponentAsync(rootComponent.ComponentType, rootComponent.Selector); } - // Users may want to configure the culture based on some ambient state such as local storage, url etc. - // If they have changed the culture since the initial load, fetch satellite assemblies for this selection. - await SatelliteResourcesLoader.LoadCurrentCultureResourcesAsync(); - await tcs.Task; } }