[FIX] mail: client action: crash on channel unsubscribe

After unsubscribing from a channel, the client action switches to inbox.
Method set_channel() takes as argument the channel to switch to, not its id.
This commit is contained in:
Aaron Bohy
2015-10-05 10:17:53 +02:00
parent 0c35468806
commit 435f748410
+1 -1
View File
@@ -462,7 +462,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
var self = this;
chat_manager
.unsubscribe(this.channel)
.then(this.set_channel.bind(this, "channel_inbox"))
.then(this.set_channel.bind(this, chat_manager.get_channel("channel_inbox")))
.then(this.render_sidebar.bind(this))
.then(function () {
var msg = _.str.sprintf(_t('You unsubscribed from <b>%s</b>.'), self.channel.name);