1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 12:38:26 +02:00

Manage private chats

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-04-28 15:35:32 +02:00
parent c6b9a84def
commit d6aa5eb0cc
3 changed files with 67 additions and 6 deletions

View File

@ -95,8 +95,13 @@ function setChannels(new_channels) {
}
if (new_channels && (!selected_channel_id || !channels[selected_channel_id])) {
if (window.location.hash)
selectChannel(window.location.hash.substring(9))
if (window.location.hash) {
let channel_id = parseInt(window.location.hash.substring(9))
if (channels[channel_id])
selectChannel(channel_id)
else
selectChannel(Object.keys(channels)[0])
}
else
selectChannel(Object.keys(channels)[0])
}