Skip to content

Commit

Permalink
Handle channel creation across clients (Fixes #170).
Browse files Browse the repository at this point in the history
  • Loading branch information
mjtko committed Mar 2, 2013
1 parent 0877f00 commit c2eb6de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Kandan.Broadcasters.FayeBroadcaster

processEventsForChannel: (eventName, data)->
Kandan.Helpers.Channels.deleteChannelById(data.entity.id) if eventName == "delete"
Kandan.Helpers.Channels.createChannelIfNotExists(channel: data.entity, channel_id: data.entity.id) if eventName == "create"

# TODO this has to be implemented
Kandan.Helpers.Channels.renameChannelById(data.entity.id, data.entity.name) if data.eventName == "update"
Expand Down
3 changes: 0 additions & 3 deletions app/assets/javascripts/backbone/views/channel_tabs.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class Kandan.Views.ChannelTabs extends Backbone.View
if channelName
channel = new Kandan.Models.Channel({name: channelName})
channel.save({}, {
success: (model)->
Kandan.Helpers.Channels.createChannelArea(model)

error: (model, response)->
_.each(JSON.parse(response.responseText), alert);
})
Expand Down

0 comments on commit c2eb6de

Please sign in to comment.