mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
cleanup fetch content in sourcesView
This commit is contained in:
@@ -37,22 +37,20 @@ class SourcesView extends React.Component<Props, State> {
|
|||||||
const { file } = this.props;
|
const { file } = this.props;
|
||||||
getContentType(file._links.self.href)
|
getContentType(file._links.self.href)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result.error) {
|
|
||||||
this.setState({
|
|
||||||
...this.state,
|
|
||||||
error: result.error,
|
|
||||||
loaded: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
this.setState({
|
||||||
...this.state,
|
...this.state,
|
||||||
contentType: result.type,
|
contentType: result.type,
|
||||||
language: result.language,
|
language: result.language,
|
||||||
loaded: true
|
loaded: true
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(error => {
|
||||||
|
this.setState({
|
||||||
|
...this.state,
|
||||||
|
error,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
showSources() {
|
showSources() {
|
||||||
|
|||||||
Reference in New Issue
Block a user