Skip to content
Snippets Groups Projects
Commit 9d290569 authored by Lucas Lefèvre's avatar Lucas Lefèvre
Browse files

[FIX] website_slides: Display button when not in fullscreen


When answering a quiz, the button "Check your answers"
is not displayed when not in fullscreen.

JS error: `def.resolve is not a function`
because an already instantiated Promise does not have a
resolve function.
A promise cannot be resolved from outside its callback scope.

closes odoo/odoo#34762

Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent 7dd718f0
No related branches found
No related tags found
No related merge requests found
......@@ -57,13 +57,11 @@ odoo.define('website_slides.quiz', function (require) {
* @override
*/
willStart: function () {
var def = new Promise(function () {});
if (this.quiz) {
def.resolve();
} else {
def = this._fetchQuiz();
var defs = [this._super.apply(this, arguments)];
if (!this.quiz) {
defs.push(this._fetchQuiz());
}
return Promise.all([this._super.apply(this, arguments), def]);
return Promise.all(defs);
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment