Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMackinnon Buck <mackinnon.buck@gmail.com>2022-06-02 00:33:47 +0300
committerMackinnon Buck <mackinnon.buck@gmail.com>2022-06-02 00:37:54 +0300
commit6562ddc0ca5477d4e76214e4c1b8a47132726c5f (patch)
tree94fa169ea646275f30131be5766abbcde60abb04
parent3418843621a9b74bccc3b41cf1fa62eae471233e (diff)
Fixed boot config issue. (#41976)mbuck/backport-fix-blazor-boot-config
-rw-r--r--src/Components/Web.JS/src/Platform/BootConfig.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Components/Web.JS/src/Platform/BootConfig.ts b/src/Components/Web.JS/src/Platform/BootConfig.ts
index 4e5c22dfd8..b752a74981 100644
--- a/src/Components/Web.JS/src/Platform/BootConfig.ts
+++ b/src/Components/Web.JS/src/Platform/BootConfig.ts
@@ -12,9 +12,15 @@ export class BootConfigResult {
loadBootResource('manifest', 'blazor.boot.json', '_framework/blazor.boot.json', '') :
defaultLoadBlazorBootJson('_framework/blazor.boot.json');
- const bootConfigResponse = loaderResponse instanceof Promise ?
- await loaderResponse :
- await defaultLoadBlazorBootJson(loaderResponse ?? '_framework/blazor.boot.json');
+ let bootConfigResponse: Response;
+
+ if (!loaderResponse) {
+ bootConfigResponse = await defaultLoadBlazorBootJson('_framework/blazor.boot.json');
+ } else if (typeof loaderResponse === 'string') {
+ bootConfigResponse = await defaultLoadBlazorBootJson(loaderResponse);
+ } else {
+ bootConfigResponse = await loaderResponse;
+ }
// While we can expect an ASP.NET Core hosted application to include the environment, other
// hosts may not. Assume 'Production' in the absence of any specified value.