Skip to content

Commit

Permalink
Merge pull request Expensify#562 from Expensify/cmartins-fixEmptyUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl authored Jun 18, 2024
2 parents 0057e4f + 9fb9563 commit b3bb9ec
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 b3bb9ec

Please sign in to comment.