Commit fe7631a5 authored by fred's avatar fred

chat: autoconnect if a nick is set

parent d41f07d0
......@@ -564,10 +564,6 @@ $(function() {
});
}
if (window.localStorage['pa-nick'] !== undefined) {
$('.nick input').val(window.localStorage['pa-nick']);
}
$('.nick input').on('keydown', function(ev) {
if (ev.keyCode == 13) {
$('.nick button').trigger('click');
......@@ -681,6 +677,11 @@ $(function() {
return true;
});
if (window.localStorage['pa-nick'] !== undefined) {
$('.nick input').val(window.localStorage['pa-nick']);
$('.nick button').click();
}
$(window).on('beforeunload', function() {
if (connection) { connection.disconnect(); }
});
......
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