typing fixed

This commit is contained in:
Piyush मिश्रः 2021-05-07 00:25:11 +05:30
parent ff358eb316
commit 53e729ede8
1 changed files with 6 additions and 4 deletions

View File

@ -80,8 +80,10 @@ let Messages = class {
if(elm.length > 0) elm.remove(); if(elm.length > 0) elm.remove();
if(typing.length == 0) return; if(typing.length == 0) return;
var text = ''; var text = '';
typing.forEach((val) => { typing.forEach((val) => {
text += val + ',' var name = vayakti[val];
if(name == undefined) name = "";
text += name+'('+val.substr(0,8)+')'+ ','
}) })
text = text.substr(0, text.length-1); text = text.substr(0, text.length-1);
text += ' is typing...' text += ' is typing...'
@ -310,10 +312,10 @@ socket.addEventListener('message', function (event) {
break; break;
case 'status': case 'status':
if(j.status == "typing") { if(j.status == "typing") {
typing.push(vayakti[j.kunjika]+"("+j.kunjika.substr(0,8)+")"); typing.push(j.kunjika);
Messages.pushTypingStatus(); Messages.pushTypingStatus();
} else if(j.status == "typing_end") { } else if(j.status == "typing_end") {
const index = typing.indexOf(vayakti[j.kunjika]+"("+j.kunjika.substr(0,8)+")"); const index = typing.indexOf(j.kunjika);
if (index > -1) typing.splice(index, 1); if (index > -1) typing.splice(index, 1);
Messages.pushTypingStatus(); Messages.pushTypingStatus();
} }