To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 66589f70 authored by Hermann's avatar Hermann
Browse files

fix reloading of group after patching

parent fe0ec541
......@@ -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());
});
}
},
}),
......
......@@ -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, {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment