mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-26 06:25:58 -05:00
Show in UX that there's a disconnect
This commit is contained in:
parent
afc6a2f4ce
commit
08f891f4f6
@ -23,6 +23,14 @@ $(function(){
|
||||
addMessageToRoom(data, current_username, 'chat');
|
||||
});
|
||||
|
||||
// Triggered when disconnected either by server stop or timeout
|
||||
socket.on('disconnect', function(data) {
|
||||
addMessageToRoom({'msg': 'The chat server is disconnected.'}, current_username, 'status');
|
||||
})
|
||||
socket.on('connect_error', function(error) {
|
||||
console.log("error");
|
||||
})
|
||||
|
||||
// Trigger new message on enter or click of send message button.
|
||||
$('#new-message').on('keypress', function(e) {
|
||||
var code = e.keyCode || e.which;
|
||||
|
Loading…
x
Reference in New Issue
Block a user