Fix get attributes diff (#5658)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-05-23 21:41:53 +04:00 committed by GitHub
parent ce6ce23444
commit 053a43e878
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,10 @@ function diffAttributes (doc: Data<Doc>, newDoc: Data<Doc>): DocumentUpdate<Doc>
const newDocuments = new Map(Object.entries(newDoc))
for (const [key, value] of allDocuments) {
if (!newDocuments.has(key)) {
continue
}
const newValue = toUndef(newDocuments.get(key))
if (!deepEqual(newValue, toUndef(value))) {
// update is required, since values are different