Skip to content

Commit

Permalink
[FIX] website_slides: reload page when joining channel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jem-odoo authored and tde-banana-odoo committed Feb 21, 2019
1 parent 1a89a3f commit 95ab97c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/website_slides/static/src/js/slides_join_channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 95ab97c

Please sign in to comment.