diff --git a/src/groups/viewGroup.js b/src/groups/viewGroup.js index adf27fcfe32fcc86bbc52dc98bca10bfb848a8bd..4ec22559128966eca3b8f1cb42882ee93ec05d2b 100644 --- a/src/groups/viewGroup.js +++ b/src/groups/viewGroup.js @@ -181,6 +181,8 @@ class EmailTable { export default class viewGroup extends ItemView { view() { + // update the reference to the controller data, as this may be refreshed in between + this.data = this.controller.data; return this.layout([ // this div is the title line m('div.maincontainer', [ @@ -214,7 +216,7 @@ export default class viewGroup extends ItemView { list: this.data.receive_from || [], onSubmit: (newItem) => { const oldList = this.data.receive_from || []; - this.handler.patch({ + this.controller.patch({ _id: this.data._id, _etag: this.data._etag, receive_from: [...oldList, newItem], @@ -226,11 +228,11 @@ export default class viewGroup extends ItemView { const index = oldList.indexOf(item); if (index !== -1) { oldList.splice(index, 1); - this.handler.patch({ + this.controller.patch({ _id: this.data._id, _etag: this.data._etag, receive_from: oldList, - }).then(() => m.redraw()); + }); } }, }), diff --git a/src/views/itemView.js b/src/views/itemView.js index 07de2f80efdb8f452b50048ce52d0e700b99188e..780cce9415124c99705c136d8048664ee563fa00 100644 --- a/src/views/itemView.js +++ b/src/views/itemView.js @@ -52,8 +52,6 @@ export default class ItemView { layout(children) { if (!this.controller || !this.controller.data) return m(loadingScreen); - // update the reference to the controller data, as this may be refreshed in between - this.data = this.controller.data; return m('div', [ m(Toolbar, m('div.pe-button-row', [ m(Button, {