mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-22 19:18:26 +02:00
Manage channels permissions
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -25,6 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
*/
|
||||
function processMessage(data) {
|
||||
// TODO Implement chat protocol
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
function setupSocket(nextDelay = 1000) {
|
||||
@ -46,6 +47,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
console.error('Chat socket closed unexpectedly, restarting…')
|
||||
setTimeout(() => setupSocket(2 * nextDelay), nextDelay)
|
||||
})
|
||||
|
||||
socket.addEventListener('open', e => {
|
||||
socket.send(JSON.stringify({
|
||||
'type': 'fetch_channels',
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
setupSocket()
|
||||
|
Reference in New Issue
Block a user