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;
|
showTryAnotherWayLink?: boolean;
|
||||||
attemptedUsername?: string;
|
attemptedUsername?: string;
|
||||||
};
|
};
|
||||||
scripts: string[];
|
scripts?: string[];
|
||||||
message?: {
|
message?: {
|
||||||
type: "success" | "warning" | "error" | "info";
|
type: "success" | "warning" | "error" | "info";
|
||||||
summary: string;
|
summary: string;
|
||||||
|
@ -10,7 +10,7 @@ export type KcContextLike = {
|
|||||||
resourcesPath: string;
|
resourcesPath: string;
|
||||||
ssoLoginInOtherTabsUrl: string;
|
ssoLoginInOtherTabsUrl: string;
|
||||||
};
|
};
|
||||||
scripts: string[];
|
scripts?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<keyof KcContextLike extends keyof KcContext ? true : false>();
|
assert<keyof KcContextLike extends keyof KcContext ? true : false>();
|
||||||
@ -45,10 +45,12 @@ export function useInitialize(params: {
|
|||||||
type: "module",
|
type: "module",
|
||||||
src: `${url.resourcesPath}/js/menu-button-links.js`
|
src: `${url.resourcesPath}/js/menu-button-links.js`
|
||||||
},
|
},
|
||||||
...scripts.map(src => ({
|
...(scripts === undefined
|
||||||
|
? []
|
||||||
|
: scripts.map(src => ({
|
||||||
type: "text/javascript" as const,
|
type: "text/javascript" as const,
|
||||||
src
|
src
|
||||||
})),
|
}))),
|
||||||
{
|
{
|
||||||
type: "module",
|
type: "module",
|
||||||
textContent: `
|
textContent: `
|
||||||
|
Loading…
x
Reference in New Issue
Block a user