Skip to content

Commit

Permalink
skip empty update
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Jun 18, 2024
1 parent 0057e4f commit 9fb9563
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Onyx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ function updateSnapshots(data: OnyxUpdate[]) {
updatedData = {...updatedData, [key]: lodashPick(value, Object.keys(snapshotData[key]))};
});

// Skip the update if there's no data to be merged
if (utils.isEmptyObject(updatedData)) {
return;
}

promises.push(() => merge(snapshotKey, {data: updatedData}));
});

Expand Down

0 comments on commit 9fb9563

Please sign in to comment.