Skip to content

Commit

Permalink
onChange: Emit changed event even if changed set is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed May 24, 2021
1 parent c2a52ae commit 025a64e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ts/models/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,12 @@ export class ConversationModel extends window.Backbone
// 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.
this.on('change', () => {
const isPropsCacheStillValid = Object.keys(this.changed).every(key =>
ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE.has(key)
const changedKeys = Object.keys(this.changed || {});
const isPropsCacheStillValid = Boolean(
changedKeys.length &&
changedKeys.every(key =>
ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE.has(key)
)
);
if (isPropsCacheStillValid) {
return;
Expand Down

0 comments on commit 025a64e

Please sign in to comment.