Commit b59344cf authored by Aral Balkan's avatar Aral Balkan
Browse files

Ensure cache of private messages is cleared on sign out

parent 41794af0
......@@ -16,6 +16,7 @@
const NORMAL_CLOSURE = 1000
onMount(() => {
console.log('============== Index mounted ==============')
// Make the public socket connection.
$publicSocket = new WebSocket(`wss://${location.hostname}/public`)
$publicSocket.onmessage = message => {
......@@ -38,10 +39,10 @@
console.log('Signed out, closing private socket.')
$privateSocket.send('Client is about to close.')
$privateSocket.close(NORMAL_CLOSURE, 'Person signed out.')
$privateToken = null
$privateMessages = []
}
}
$privateToken = null
$privateMessages = []
}
})
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment