remove fetching docs in render in DocumentView

This commit is contained in:
2019-02-12 20:25:45 +03:00
parent f9522aa0fb
commit 2183f68c0a

View File

@@ -47,12 +47,21 @@ export class DocumentViewComponent extends React.PureComponent<
</div>
);
} else {
if (!this.props.allDocs && !this.props.fetching) {
this.props.fetchDocs();
}
return this.props.spinner && <LoadingStub />;
}
}
public componentDidUpdate() {
if (!this.props.allDocs && !this.props.fetching) {
this.props.fetchDocs();
}
}
public componentDidMount() {
if (!this.props.allDocs && !this.props.fetching) {
this.props.fetchDocs();
}
}
}
function mapStateToProps(state: IAppState) {