Skip to content

Commit

Permalink
Merge pull request #421 from AbhieShinde/patch-1
Browse files Browse the repository at this point in the history
onSaved() is not being called for Map
  • Loading branch information
jmeistrich authored Dec 29, 2024
2 parents 2d26071 + 2f0b1e4 commit 9460e6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sync-plugins/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ export function syncedCrud<TRemote extends object, TLocal = TRemote, TAsOption e
const currentValue = isChild
? ((asType === 'array' && isArray(currentPeeked)
? currentPeeked.find((v) => v[fieldId] === itemKey)
: undefined) ?? currentPeeked[itemKey])
: undefined) ??
(asType === 'Map' ? currentPeeked.get(itemKey) : currentPeeked[itemKey]))
: currentPeeked;

// If this value has been deleted locally before this finished saving then ignore the result
Expand Down

0 comments on commit 9460e6f

Please sign in to comment.