Skip to content

Commit

Permalink
fixing reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
mgamini committed Nov 21, 2014
1 parent 268b74e commit db1e033
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions phoenix-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ App.Phoenix.Socket = Ember.Controller.extend({
addTopic: function(channelName, topicName, channel, message, callback) {
var topicKey = channelName + ":" + topicName;

if (this.get('channels').get(topicKey)) {
callback(this.get('channels').get(topicKey), true);
} else {
this.get('channels').set(topicKey, channel);
this.get('socket').join(channelName, topicName, message || {}, this.get('handleAddTopic').bind(this, topicKey, callback));
}
this.get('channels').set(topicKey, channel);
this.get('socket').join(channelName, topicName, message || {}, this.get('handleAddTopic').bind(this, topicKey, callback));
},
handleAddTopic: function(topicKey, callback, channel) {
channel.on("join", function(res) {
Expand Down
2 changes: 1 addition & 1 deletion phoenix-socket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db1e033

Please sign in to comment.