Skip to content

Commit

Permalink
fix: crud=true/false issues
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed May 17, 2021
1 parent 8a80ff8 commit 00172af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/core.js
Expand Up @@ -158,9 +158,15 @@ class CoCreateYSocket {
detail: wholestring
})


const update_event = new CustomEvent('cocreate-crdt-update', {
detail: eventDelta
detail: eventDelta,
})
const update_event2 = new CustomEvent('cocreate-crdt-update', {
detail: {eventDelta,...info},
})

window.dispatchEvent(update_event2);
elements.forEach((el) => {
if (crud.isReadAttr(el) && el.getAttribute('name') === info.name) {
el.dispatchEvent(update_event)
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -60,7 +60,7 @@ class CoCreateCRDTClass extends CoCreateYSocket
}
this.insertData(id, 0, textValue);
}
if (info.updateCrud) {
if (info.crud != false) {
crud.updateDocument({
collection: info.collection,
document_id: info.document_id,
Expand Down

0 comments on commit 00172af

Please sign in to comment.