From 18d3babc2cfe8d11ce2f45eab318da04c8ea57ff Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 18 May 2014 10:49:38 +0300 Subject: [PATCH] Fix debug console. Remove silly subscription logic. --- static/cosmopolite.js | 17 +++++------------ static/debug.html | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/static/cosmopolite.js b/static/cosmopolite.js index b9a722e..65979ed 100644 --- a/static/cosmopolite.js +++ b/static/cosmopolite.js @@ -109,18 +109,11 @@ Cosmopolite.prototype.subscribe = function(subject, messages, keys) { 'messages': messages, 'keys': keys, }; - this.sendRPC_('subscribe', args, function() { - if (subject in this.subscriptions_) { - console.log( - this.loggingPrefix_(), 'duplicate subject subscriptions:', subject); - } else { - this.subscriptions_[subject] = { - 'messages': [], - 'keys': {}, - }; - } - resolve(); - }.bind(this)); + this.subscriptions_[subject] = { + 'messages': [], + 'keys': {}, + }; + this.sendRPC_('subscribe', args, resolve); }.bind(this)); }; diff --git a/static/debug.html b/static/debug.html index ddd5f9f..465600d 100644 --- a/static/debug.html +++ b/static/debug.html @@ -74,7 +74,7 @@ window.addEventListener('load', function() { '(log in)'; }, onMessage: function(message) { - if (subscriptions.value != message['subject']) { + if (subscriptions.value != message['subject']['name']) { return; } addMessage(message);