The project advance
This commit is contained in:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user