From fc95f1b6a83def7b531ead81ec09a33cbf4d5f57 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 8 Aug 2017 10:32:25 +0200 Subject: [PATCH] lint compliance --- www/common/common-messaging.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index 0880ec296..f11d17293 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -264,8 +264,9 @@ define([ return; } + var parsed; try { - var parsed = JSON.parse(decryptedMsg); + parsed = JSON.parse(decryptedMsg); } catch (e) { console.error(decryptedMsg); return; @@ -324,7 +325,6 @@ define([ var createChatBox = function (common, $container, curvePublic, messenger) { var data = getFriend(common, curvePublic); - var proxy = common.getProxy(); // Input var channel = channels[data.channel]; @@ -393,7 +393,7 @@ define([ channel.send(payload, function (e) { if (e) { channel.sending = false; - console.error(err); + console.error(e); return; } $input.val(''); @@ -508,6 +508,7 @@ define([ channel.lastDisplayed = i-1; channel.unnotify(); + // return void channel.notify(); if (messages.length > 10) { var lastKnownMsg = messages[messages.length - 11]; channel.setLastMessageRead(lastKnownMsg.sig); @@ -675,6 +676,12 @@ define([ setLastMessageRead: function (hash) { data.lastKnownHash = hash; }, + getLastMessageRead: function () { + return data.lastKnownHash; + }, + isActive: function () { + return data.curvePublic === Msg.active; + }, getMessagesSinceDisconnect: function () { getChannelMessagesSince(network, chan, data, keys); },