From 8d2663a93d80bf6f6bd3d91ba777733607214c33 Mon Sep 17 00:00:00 2001 From: "damian.przygodzki" Date: Mon, 6 Mar 2017 13:27:51 +0100 Subject: [PATCH] #489 ConnectWS moved to after data fetching --- src/components/app/DocumentList.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/app/DocumentList.js b/src/components/app/DocumentList.js index ea977bf5a..b68992232 100644 --- a/src/components/app/DocumentList.js +++ b/src/components/app/DocumentList.js @@ -99,7 +99,6 @@ class DocumentList extends Component { this.setState({ viewId: defaultViewId }); - this.connectWS(defaultViewId); } /* @@ -122,11 +121,6 @@ class DocumentList extends Component { } } - componentDidMount() { - const {viewId} = this.state; - this.connectWS(viewId); - } - componentWillUnmount() { this.disconnectWS(); } @@ -258,7 +252,9 @@ class DocumentList extends Component { filters: response.data.filters }, refresh && { refresh: Date.now() - })) + }), () => { + this.connectWS(response.data.viewId); + }) }); }