Skip to content

Commit

Permalink
Add label for getDiffProp comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Oct 24, 2023
1 parent 9d1bbd7 commit fe03ef4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/data/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,9 @@ const getWithConflictDetails = (defs) => {
if (v.version > 1) { // v.root is false here - can use either
const conflict = v.version !== (v.baseVersion + 1);

v.baseDiff = getDiffProp(v.dataReceived, defMap.get(v.baseVersion).data);
if ('label' in v.dataReceived && v.dataReceived.label !== defMap.get(v.baseVersion).label) v.baseDiff.push('label');
v.baseDiff = getDiffProp(v.dataReceived, { ...defMap.get(v.baseVersion).data, label: defMap.get(v.baseVersion).label });

v.serverDiff = getDiffProp(v.dataReceived, defMap.get(v.version - 1).data);
if ('label' in v.dataReceived && v.dataReceived.label !== defMap.get(v.version - 1).label) v.serverDiff.push('label');
v.serverDiff = getDiffProp(v.dataReceived, { ...defMap.get(v.version - 1).data, label: defMap.get(v.version - 1).label });

if (conflict) {
v.conflict = v.conflictingProp && v.conflictingProp.length > 0 ? ConflictType.HARD : ConflictType.SOFT;
Expand Down

0 comments on commit fe03ef4

Please sign in to comment.