Load satellite resources before rendering components

This commit is contained in:
Pranav K 2020-03-29 15:20:59 -07:00
parent 07b12fe0bc
commit 248b31e0fb
No known key found for this signature in database
GPG Key ID: 1963DA6D96C3057A
1 changed files with 4 additions and 4 deletions

View File

@ -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<object>();
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;
}
}