As described in #129974, the colorpicker cannot cache a promise protected by `useService`. #129974 fixes the issue by through non idiomatic practice (calling a service that is not protected by `useService`). This commit fixes the issue idiomatically. This commit caches the promise directly from a service and removes the caching code from the `ColorPalette`. task-3446691 closes odoo/odoo#130789 X-original-commit: 1d2e54088b0f0e28464ab6aa884fb2e1110e8e04 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
17 lines
586 B
JavaScript
17 lines
586 B
JavaScript
/** @odoo-module */
|
|
|
|
import { patch } from '@web/core/utils/patch';
|
|
import { registry } from '@web/core/registry';
|
|
import { utils } from '@web/../tests/helpers/mock_env';
|
|
import { getColorPickerTemplateService } from '@web_editor/js/wysiwyg/get_color_picker_template_service';
|
|
|
|
const { prepareRegistriesWithCleanup } = utils;
|
|
|
|
const serviceRegistry = registry.category('services');
|
|
patch(utils, {
|
|
prepareRegistriesWithCleanup() {
|
|
prepareRegistriesWithCleanup(...arguments);
|
|
serviceRegistry.add('get_color_picker_template', getColorPickerTemplateService);
|
|
},
|
|
});
|