[FIX] website: fix website text edition test
Since [1] the `website_text_edition` tour fails because it manages to change tab, drop a block, select a paragraph and click on a button before the bundle reload happens. This commit makes sure `updateOptionsUI` is awaited and that any subsequent call is only queued afterwards. task-3370939 [1]: https://github.com/odoo/odoo/commit/c511e100cad2febc0ebb9ce61b5eb52232e60f7d closes odoo/odoo#129855 X-original-commit: 81abdb96aeb95e492230d39000e28c0d239840de Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This commit is contained in:
@@ -462,18 +462,20 @@ const wSnippetMenu = weSnippetEditor.SnippetsMenu.extend({
|
||||
* @private
|
||||
*/
|
||||
_onReloadBundles(ev) {
|
||||
this._mutex.exec(() => {
|
||||
const excludeSelector = this.optionsTabStructure.map(element => element[0]).join(', ');
|
||||
for (const editor of this.snippetEditors) {
|
||||
if (!editor.$target[0].matches(excludeSelector)) {
|
||||
if (this._currentTab === this.tabs.THEME) {
|
||||
const excludeSelector = this.optionsTabStructure.map(element => element[0]).join(', ');
|
||||
for (const editor of this.snippetEditors) {
|
||||
if (!editor.$target[0].matches(excludeSelector)) {
|
||||
if (this._currentTab === this.tabs.THEME) {
|
||||
this._mutex.exec(() => {
|
||||
editor.destroy();
|
||||
} else {
|
||||
editor.updateOptionsUI(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this._mutex.exec(async () => {
|
||||
await editor.updateOptionsUI(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user