Skip to content

Commit

Permalink
Using the revision has the Map key. This allows us to cache the revis…
Browse files Browse the repository at this point in the history
…ion sets themselves and account for changes to Unsaved revisions.
  • Loading branch information
ramonjd committed Dec 3, 2023
1 parent f1739e7 commit 6f76d61
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export function getRevisionChanges(
blockNames,
maxResults = 5
) {
if ( cache.has( revision.id ) ) {
return cache.get( revision.id );
if ( cache.has( revision ) ) {
return cache.get( revision );
}

const changedValueTree = deepCompare(
Expand Down Expand Up @@ -119,7 +119,7 @@ export function getRevisionChanges(
joined += '…';
}

cache.set( revision.id, joined );
cache.set( revision, joined );

return joined;
}
Expand Down

0 comments on commit 6f76d61

Please sign in to comment.