diff --git a/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js b/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js index b83d85d6c13..336278077bc 100644 --- a/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js +++ b/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js @@ -2,6 +2,7 @@ 'use strict'; const { Component } = owl; +const { onPatched } = owl.hooks; /** * Compares `a` and `b` up to the given `propsCompareDepth`. @@ -55,7 +56,11 @@ function isEqual(a, b, propsCompareDepth) { */ export function useShouldUpdateBasedOnProps({ propsCompareDepth = {} } = {}) { const component = Component.current; + let forceRender = false; component.shouldUpdate = nextProps => { + if (forceRender) { + return true; + } const allNewProps = Object.assign({}, nextProps); const defaultProps = component.constructor.defaultProps; for (const key in defaultProps) { @@ -63,6 +68,8 @@ export function useShouldUpdateBasedOnProps({ propsCompareDepth = {} } = {}) { allNewProps[key] = defaultProps[key]; } } - return !isEqual(component.props, allNewProps, propsCompareDepth); + forceRender = !isEqual(component.props, allNewProps, propsCompareDepth); + return forceRender; }; + onPatched(() => forceRender = false); }