diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 3725f53e5bd..0531cdd85d8 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -727,8 +727,8 @@ var Wysiwyg = Widget.extend({ return this._saveWebsiteContent(context) .then(() => { this.trigger_up('edition_was_stopped'); + window.onbeforeunload = null; if (reload) { - window.onbeforeunload = null; window.location.reload(); } }).catch(error => {