Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
- move the websocket connect to layout response #1820
Browse files Browse the repository at this point in the history
  • Loading branch information
siemiatj committed Jun 1, 2018
1 parent 70f3f4b commit d962ff5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/app/DocumentList.js
Expand Up @@ -227,6 +227,7 @@ class DocumentList extends Component {

connectWebSocket = viewId => {
const { windowType } = this.props;

connectWS.call(this, `/view/${viewId}`, msg => {
const { fullyChanged, changedIds } = msg;
if (changedIds) {
Expand Down Expand Up @@ -376,14 +377,16 @@ class DocumentList extends Component {
layout: response.data,
},
() => {
if (viewId && !isNewFilter) {
this.browseView();
} else {
if (viewId) {
this.filterView();
if (viewId) {
this.connectWebSocket(viewId);

if (!isNewFilter) {
this.browseView();
} else {
this.createView();
this.filterView();
}
} else {
this.createView();
}
setModalTitle && setModalTitle(response.data.caption);
}
Expand Down Expand Up @@ -447,6 +450,7 @@ class DocumentList extends Component {
viewId: response.data.viewId,
},
() => {
this.connectWebSocket(response.data.viewId);
this.getData(response.data.viewId, page, sort);
}
);
Expand Down Expand Up @@ -552,7 +556,6 @@ class DocumentList extends Component {
})
);
}
this.connectWebSocket(response.data.viewId);
}
);
}
Expand Down

0 comments on commit d962ff5

Please sign in to comment.