add channel saving

This commit is contained in:
Mystikfluu 2022-08-12 23:54:06 +02:00
parent a326008224
commit 656b3d4de0
2 changed files with 4 additions and 2 deletions

View File

@ -9,7 +9,7 @@ var reply_id = 0
var highest_id
var currentChannel = "none"
var currentChannel = sessionStorage.getItem("lastdm") || "none"
let socket = new WebSocket(wss_URI);
socket.addEventListener("message", async function (event) {
@ -333,6 +333,7 @@ document.addEventListener("visibilitychange", function() {
});
function switchChannel(channelname) {
sessionStorage.setItem("lastdm", channelname);
currentChannel = channelname
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
}

View File

@ -9,7 +9,7 @@ var reply_id = 0
var highest_id
var currentChannel = "everyone"
var currentChannel = sessionStorage.getItem("lastchannel") || "everyone"
let socket = new WebSocket(wss_URI);
socket.addEventListener("message", async function (event) {
@ -330,6 +330,7 @@ if(window.location.href.includes("message=")) {
}
function switchChannel(channelname) {
sessionStorage.setItem("lastchannel", channelname);
currentChannel = channelname
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
}