diff options
author | Marvin Borner | 2019-02-11 21:08:23 +0100 |
---|---|---|
committer | Marvin Borner | 2019-02-11 21:08:23 +0100 |
commit | 9d90e34e10f07ee92045e479979cbe41c09d6501 (patch) | |
tree | a8b3f727cc590c24e4d8bd1db7664b9e29005ce2 /public | |
parent | 8b9695970ece3f5f123019cde4e32e4978f94b57 (diff) |
Added some anonymize features
Diffstat (limited to 'public')
-rw-r--r-- | public/scripts/chat.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/public/scripts/chat.js b/public/scripts/chat.js index 0cb5449..ddb1652 100644 --- a/public/scripts/chat.js +++ b/public/scripts/chat.js @@ -244,8 +244,14 @@ function chat() { $('#logout').on('click', () => location.reload(true)); $('#delete').on('click', () => deleteAccount()); $('#anonymize').on('click', () => { - peer.disconnect(); - swal('Disconnected from broker server!', 'You will still be able to send and receive messages.', 'success') + if (peer.disconnected) { + swal('Reconnected to broker server!', 'You can now connect to new peers again.', 'success').then(() => + peer.reconnect() + ) + } else { + peer.disconnect(); + swal('Disconnected from broker server!', 'You will still be able to send and receive messages.', 'success') + } }); $('#call').on('click', () => getMediaStream(stream => { call = peer.call(peerId, stream); // TODO: Encrypt call |