many small fixes

This commit is contained in:
Joseph Garrone
2021-03-08 00:09:52 +01:00
parent b93003e76d
commit 12e83c9468
16 changed files with 298 additions and 106 deletions

View File

@ -1,9 +1,10 @@
import { createUseGlobalState } from "powerhooks";
import { kcContext } from "../kcContext";
import { kcContext } from "../KcContext";
import { getBestMatchAmongKcLanguageTag } from "./KcLanguageTag";
export const { useKcLanguageTag } = createUseGlobalState(
//export const { useKcLanguageTag, evtKcLanguageTag } = createUseGlobalState(
const wrap = createUseGlobalState(
"kcLanguageTag",
() => getBestMatchAmongKcLanguageTag(
kcContext?.locale?.current ??
@ -11,3 +12,12 @@ export const { useKcLanguageTag } = createUseGlobalState(
),
{ "persistance": "cookie" }
);
export const { useKcLanguageTag } = wrap;
export function getEvtKcLanguage() {
return wrap.evtKcLanguageTag;
}