Added debug for selfserve (#623)

This commit is contained in:
Srinath Narayanan 2021-04-06 12:58:49 -07:00 committed by GitHub
parent 0f88176a27
commit 9c6178d0ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -109,6 +109,16 @@ const handleMessage = async (event: MessageEvent): Promise<void> => {
subscriptionId: inputs.subscriptionId,
});
if (i18n.isInitialized) {
await displaySelfServeComponent(selfServeType);
} else {
i18n.on("initialized", async () => {
await displaySelfServeComponent(selfServeType);
});
}
};
const displaySelfServeComponent = async (selfServeType: SelfServeType): Promise<void> => {
const descriptor = await getDescriptor(selfServeType);
ReactDOM.render(renderComponent(descriptor), document.getElementById("selfServeContent"));
};

View File

@ -8,14 +8,15 @@ i18n
.init({
fallbackLng: "en",
detection: { order: ["navigator", "cookie", "localStorage", "sessionStorage", "querystring", "htmlTag"] },
debug: process.env.NODE_ENV === "development",
// temporarily setting debug to true to investigate loading issues in prod
debug: true,
keySeparator: ".",
interpolation: {
formatSeparator: ",",
},
react: {
wait: true,
bindI18n: "languageChanged loaded",
bindI18n: "languageChanged added loaded",
bindI18nStore: "added removed",
nsMode: "default",
useSuspense: false,