lang: unit tests in django/await first loading of dict

This commit is contained in:
AdrienLSH
2024-02-13 14:49:38 +01:00
parent b398134101
commit 157383748f
3 changed files with 34 additions and 4 deletions

View File

@ -49,7 +49,10 @@ const navigateTo = async (uri) => {
}
};
const reloadView = async _ => renderView(lastView);
const reloadView = async _ => {
await lastView?.leavePage();
await renderView(lastView);
}
async function renderView(view)
{
@ -142,10 +145,12 @@ document.addEventListener("DOMContentLoaded", async () => {
});
//Languages
await lang.waitLoading();
Array.from(document.getElementById('languageSelector').children).forEach(el => {
el.onclick = async _ => {
if (await lang.changeLanguage(el.value))
return;
console.log(lang);
document.querySelector('#languageSelector > .active')?.classList.remove('active');
el.classList.add('active');
};