Fix: kcContext.scripts can be undefined in error.ftl
This commit is contained in:
parent
263f55fdd3
commit
e261736fa3
@ -102,7 +102,7 @@ export declare namespace KcContext {
|
||||
showTryAnotherWayLink?: boolean;
|
||||
attemptedUsername?: string;
|
||||
};
|
||||
scripts: string[];
|
||||
scripts?: string[];
|
||||
message?: {
|
||||
type: "success" | "warning" | "error" | "info";
|
||||
summary: string;
|
||||
|
@ -10,7 +10,7 @@ export type KcContextLike = {
|
||||
resourcesPath: string;
|
||||
ssoLoginInOtherTabsUrl: string;
|
||||
};
|
||||
scripts: string[];
|
||||
scripts?: string[];
|
||||
};
|
||||
|
||||
assert<keyof KcContextLike extends keyof KcContext ? true : false>();
|
||||
@ -45,10 +45,12 @@ export function useInitialize(params: {
|
||||
type: "module",
|
||||
src: `${url.resourcesPath}/js/menu-button-links.js`
|
||||
},
|
||||
...scripts.map(src => ({
|
||||
type: "text/javascript" as const,
|
||||
src
|
||||
})),
|
||||
...(scripts === undefined
|
||||
? []
|
||||
: scripts.map(src => ({
|
||||
type: "text/javascript" as const,
|
||||
src
|
||||
}))),
|
||||
{
|
||||
type: "module",
|
||||
textContent: `
|
||||
|
Loading…
x
Reference in New Issue
Block a user