Download terms when kcContext.termsAcceptanceRequired is set to true
This commit is contained in:
parent
c2b990ac53
commit
25621182c9
@ -14,6 +14,7 @@ export type KcContextLike = {
|
|||||||
locale?: {
|
locale?: {
|
||||||
currentLanguageTag: string;
|
currentLanguageTag: string;
|
||||||
};
|
};
|
||||||
|
termsAcceptanceRequired?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<KcContext extends KcContextLike ? true : false>();
|
assert<KcContext extends KcContextLike ? true : false>();
|
||||||
@ -38,12 +39,10 @@ export function useDownloadTerms(params: {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (kcContext.pageId !== "terms.ftl") {
|
if (kcContext.pageId === "terms.ftl" || kcContext.termsAcceptanceRequired) {
|
||||||
return;
|
downloadTermMarkdownMemoized(kcContext.locale?.currentLanguageTag ?? fallbackLanguageTag).then(
|
||||||
|
thermMarkdown => (evtTermMarkdown.state = thermMarkdown)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadTermMarkdownMemoized(kcContext.locale?.currentLanguageTag ?? fallbackLanguageTag).then(
|
|
||||||
thermMarkdown => (evtTermMarkdown.state = thermMarkdown)
|
|
||||||
);
|
|
||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user