onChange: Emit changed event even if changed set is empty
This commit is contained in:
parent
79a90802c0
commit
09ef4d85e0
1 changed files with 6 additions and 2 deletions
|
@ -293,8 +293,12 @@ export class ConversationModel extends window.Backbone
|
||||||
// We clear our cached props whenever we change so that the next call to format() will
|
// We clear our cached props whenever we change so that the next call to format() will
|
||||||
// result in refresh via a getProps() call. See format() below.
|
// result in refresh via a getProps() call. See format() below.
|
||||||
this.on('change', () => {
|
this.on('change', () => {
|
||||||
const isPropsCacheStillValid = Object.keys(this.changed).every(key =>
|
const changedKeys = Object.keys(this.changed || {});
|
||||||
|
const isPropsCacheStillValid = Boolean(
|
||||||
|
changedKeys.length &&
|
||||||
|
changedKeys.every(key =>
|
||||||
ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE.has(key)
|
ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE.has(key)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
if (isPropsCacheStillValid) {
|
if (isPropsCacheStillValid) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue