mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-21 13:04:36 -04:00
Show in UX that there's a disconnect
This commit is contained in:
parent
9d00627df3
commit
3a6de61e66
1 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,14 @@ $(function(){
|
||||||
addMessageToRoom(data, current_username, 'chat');
|
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.
|
// Trigger new message on enter or click of send message button.
|
||||||
$('#new-message').on('keypress', function(e) {
|
$('#new-message').on('keypress', function(e) {
|
||||||
var code = e.keyCode || e.which;
|
var code = e.keyCode || e.which;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue