diff options
author | Mackinnon Buck <mackinnon.buck@gmail.com> | 2022-06-02 00:33:47 +0300 |
---|---|---|
committer | Mackinnon Buck <mackinnon.buck@gmail.com> | 2022-06-02 00:37:54 +0300 |
commit | 6562ddc0ca5477d4e76214e4c1b8a47132726c5f (patch) | |
tree | 94fa169ea646275f30131be5766abbcde60abb04 | |
parent | 3418843621a9b74bccc3b41cf1fa62eae471233e (diff) |
Fixed boot config issue. (#41976)mbuck/backport-fix-blazor-boot-config
-rw-r--r-- | src/Components/Web.JS/src/Platform/BootConfig.ts | 12 |
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. |