mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +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;
|
||||
getContentType(file._links.self.href)
|
||||
.then(result => {
|
||||
if (result.error) {
|
||||
this.setState({
|
||||
...this.state,
|
||||
error: result.error,
|
||||
loaded: true
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
...this.state,
|
||||
contentType: result.type,
|
||||
language: result.language,
|
||||
loaded: true
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
...this.state,
|
||||
contentType: result.type,
|
||||
language: result.language,
|
||||
loaded: true
|
||||
});
|
||||
})
|
||||
.catch(err => {});
|
||||
.catch(error => {
|
||||
this.setState({
|
||||
...this.state,
|
||||
error,
|
||||
loaded: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
showSources() {
|
||||
|
||||
Reference in New Issue
Block a user