Merge branch 'Chatte' into feat/accounts

This commit is contained in:
2023-11-27 15:48:11 +01:00
9 changed files with 107 additions and 32 deletions

View File

@ -3,6 +3,7 @@ import Dashboard from "./views/Dashboard.js";
import Posts from "./views/Posts.js";
import PostView from "./views/PostView.js";
import Settings from "./views/Settings.js";
import Chat from "./views/Chat.js";
import { Client } from "./api/client.js";
import RegisterView from "./views/accounts/RegisterView.js";
@ -33,6 +34,7 @@ const router = async () => {
{ path: "/settings", view: Settings },
{ path: "/login", view: LoginView },
{ path: "/register", view: RegisterView },
{ path: "/chat", view: Chat },
];
// Test each route for potential match
@ -55,6 +57,8 @@ const router = async () => {
const view = new match.route.view(getParams(match));
document.querySelector("#app").innerHTML = await view.getHtml();
await view.postInit();
};
window.addEventListener("popstate", router);
@ -70,4 +74,4 @@ document.addEventListener("DOMContentLoaded", () => {
router();
});
export { client }
export { client }