[FIX] website_slides: reload page when joining channel

When a user join a channel, the button 'join' changed and indicates
him that he is now member, but since the page is not refreshed, he
still can not access to slides displayed on the page.
This commit makes the widget trigger a page refresh.

Commit linked to task ID 1941250 and PR #31317.
This commit is contained in:
jem-odoo
2019-02-21 16:38:17 +00:00
committed by Thibault Delavallée
parent 1a89a3fcc4
commit 95ab97c2f3
@@ -51,10 +51,10 @@ var JoinChannelButton = Widget.extend({
},
}).then(function (data) {
if (! data.error) {
self.$('a.o_wslides_join_channel_link').text(_t('Joined'));
location.reload();
} else {
if (data.error === 'public_user') {
self._popoverAlert(self.$el, _.str.sprintf(_t('Please <a href="/web/login?redirect=%s">login</a> to join this channel.'), (document.URL)));
self._popoverAlert(self.$el, _.str.sprintf(_t('Please <a href="/web/login?redirect=%s">login</a> to join this course.'), (document.URL)));
} else if (data.error === 'join_done') {
self._popoverAlert(self.$el, _t('You have already joined this channel'));
} else {