minor fix

This commit is contained in:
Piyush मिश्रः 2021-02-22 11:37:50 +05:30
parent b5c0bd6740
commit 6017a45e35
2 changed files with 11 additions and 3 deletions

View File

@ -182,8 +182,8 @@ impl WsSansad {
// heartbeat timed out // heartbeat timed out
// stop actor // stop actor
ctx.stop(); futures::executor::block_on(act.leave_grih()); // notify leaving
ctx.stop();
// don't try to send a ping // don't try to send a ping
return; return;
} }
@ -202,6 +202,7 @@ impl WsSansad {
// heartbeat timed out // heartbeat timed out
// stop actor // stop actor
futures::executor::block_on(act.leave_grih()); // notify leaving
ctx.stop(); ctx.stop();
// don't try to send a ping // don't try to send a ping

View File

@ -177,7 +177,10 @@ function connect(frm) {
$('#progressbar').removeClass('hidden'); $('#progressbar').removeClass('hidden');
var data = {}; var data = {};
frm.serializeArray().forEach(el => { frm.serializeArray().forEach(el => {
data[el.name] = el.value; if(typeof el.value == 'string')
data[el.name] = el.value.trim();
else
data[el.name] = el.value;
}); });
if(data['length'] !== undefined) { if(data['length'] !== undefined) {
data['length'] = parseInt(data['length']); data['length'] = parseInt(data['length']);
@ -222,7 +225,10 @@ function connect_next() {
socket.send(JSON.stringify({ cmd: 'randnext' })); socket.send(JSON.stringify({ cmd: 'randnext' }));
} }
var leaving = false;
function leave() { function leave() {
if(leaving) return;
leaving = true;
callbacks = []; callbacks = [];
callbacks.push(() => { callbacks.push(() => {
$('#progressbar').addClass('hidden'); $('#progressbar').addClass('hidden');
@ -234,6 +240,7 @@ function leave() {
myinfo.kunjika = ''; myinfo.kunjika = '';
myinfo.name = ''; myinfo.name = '';
joining = false; joining = false;
leaving = false;
}); });
socket.send(JSON.stringify({ socket.send(JSON.stringify({
cmd: 'leave' cmd: 'leave'