add channel saving
This commit is contained in:
parent
a326008224
commit
656b3d4de0
@ -9,7 +9,7 @@ var reply_id = 0
|
|||||||
|
|
||||||
var highest_id
|
var highest_id
|
||||||
|
|
||||||
var currentChannel = "none"
|
var currentChannel = sessionStorage.getItem("lastdm") || "none"
|
||||||
|
|
||||||
let socket = new WebSocket(wss_URI);
|
let socket = new WebSocket(wss_URI);
|
||||||
socket.addEventListener("message", async function (event) {
|
socket.addEventListener("message", async function (event) {
|
||||||
@ -333,6 +333,7 @@ document.addEventListener("visibilitychange", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function switchChannel(channelname) {
|
function switchChannel(channelname) {
|
||||||
|
sessionStorage.setItem("lastdm", channelname);
|
||||||
currentChannel = channelname
|
currentChannel = channelname
|
||||||
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
|
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ var reply_id = 0
|
|||||||
|
|
||||||
var highest_id
|
var highest_id
|
||||||
|
|
||||||
var currentChannel = "everyone"
|
var currentChannel = sessionStorage.getItem("lastchannel") || "everyone"
|
||||||
|
|
||||||
let socket = new WebSocket(wss_URI);
|
let socket = new WebSocket(wss_URI);
|
||||||
socket.addEventListener("message", async function (event) {
|
socket.addEventListener("message", async function (event) {
|
||||||
@ -330,6 +330,7 @@ if(window.location.href.includes("message=")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switchChannel(channelname) {
|
function switchChannel(channelname) {
|
||||||
|
sessionStorage.setItem("lastchannel", channelname);
|
||||||
currentChannel = channelname
|
currentChannel = channelname
|
||||||
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
|
socket.send(JSON.stringify({"id":"switchChannel","data":channelname}))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user