add history state navigation

This commit is contained in:
MathMan05
2024-11-25 15:29:01 -06:00
parent 04f634a708
commit 906f4a51d6
5 changed files with 17 additions and 11 deletions

View File

@@ -148,7 +148,12 @@ import { I18n } from "./i18n.js";
const pasteImageElement = document.getElementById("pasteimage") as HTMLDivElement;
let replyingTo: Message | null = null;
window.addEventListener("popstate",(e)=>{
if(e.state instanceof Object){
thisUser.goToChannel(e.state[1],false);
}
//console.log(e.state,"state:3")
})
async function handleEnter(event: KeyboardEvent): Promise<void>{
if(thisUser.keyup(event)){return}
const channel = thisUser.channelfocus;