[FIX] website: await async part when changing transparent header color
Commit [1] adapted the topMenuColor option to the 14.0 editor but did not await the call to action_demand. This didn't cause any issue but could lead to race conditions and is not correct. It also breaks after [2]. [1]: https://github.com/odoo/odoo/commit/98c8438f5225dbc34b15fc2ed5b9918d537bb71b [2]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b task-2687506 closes odoo/odoo#96059 X-original-commit: a22afd698e7c04d302a1c90888b015413dd8c930 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
This commit is contained in:
@@ -2239,12 +2239,16 @@ options.registry.topMenuColor = options.Class.extend({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
selectStyle(previewMode, widgetValue, params) {
|
||||
this._super(...arguments);
|
||||
async selectStyle(previewMode, widgetValue, params) {
|
||||
await this._super(...arguments);
|
||||
const className = widgetValue ? (params.colorPrefix + widgetValue) : '';
|
||||
this.trigger_up('action_demand', {
|
||||
actionName: 'toggle_page_option',
|
||||
params: [{name: 'header_color', value: className}],
|
||||
await new Promise((resolve, reject) => {
|
||||
this.trigger_up('action_demand', {
|
||||
actionName: 'toggle_page_option',
|
||||
params: [{name: 'header_color', value: className}],
|
||||
onSuccess: resolve,
|
||||
onFailure: reject,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user