We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b58dbc5 + de00a22 commit 299ea2dCopy full SHA for 299ea2d
1 file changed
lib/Onyx.ts
@@ -556,7 +556,7 @@ function updateSnapshots(data: OnyxUpdate[]) {
556
return;
557
}
558
559
- let updatedData = {};
+ let updatedData: Record<string, unknown> = {};
560
561
data.forEach(({key, value}) => {
562
// snapshots are normal keys so we want to skip update if they are written to Onyx
@@ -573,7 +573,10 @@ function updateSnapshots(data: OnyxUpdate[]) {
573
574
575
576
- updatedData = {...updatedData, [key]: lodashPick(value, Object.keys(snapshotData[key]))};
+ const oldValue = updatedData[key] || {};
577
+ const newValue = lodashPick(value, Object.keys(snapshotData[key]));
578
+
579
+ updatedData = {...updatedData, [key]: Object.assign(oldValue, newValue)};
580
});
581
582
// Skip the update if there's no data to be merged
0 commit comments