The project advance

This commit is contained in:
Xamora
2023-11-27 21:59:41 +01:00
parent ffbfe2ddd0
commit 8bce7d33ca
5 changed files with 14 additions and 3 deletions

View File

@ -10,6 +10,8 @@ import RegisterView from "./views/accounts/RegisterView.js";
let client = new Client(location.protocol + "//" + location.host)
let lastView = undefined
const pathToRegex = path => new RegExp("^" + path.replace(/\//g, "\\/").replace(/:\w+/g, "(.+)") + "$");
const getParams = match => {
@ -54,7 +56,10 @@ const router = async () => {
};
}
if (lastView !== undefined)
await lastView.leavePage();
const view = new match.route.view(getParams(match));
lastView = view;
document.querySelector("#app").innerHTML = await view.getHtml();