mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
fixes refetching loop for non existing changesets
This commit is contained in:
@@ -48,15 +48,15 @@ type Props = WithTranslation & {
|
||||
|
||||
class ChangesetView extends React.Component<Props> {
|
||||
componentDidMount() {
|
||||
const { fetchChangesetIfNeeded, repository } = this.props;
|
||||
const id = this.props.match.params.id;
|
||||
const { fetchChangesetIfNeeded, repository, id } = this.props;
|
||||
fetchChangesetIfNeeded(repository, id);
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const { fetchChangesetIfNeeded, repository } = this.props;
|
||||
const id = this.props.match.params.id;
|
||||
fetchChangesetIfNeeded(repository, id);
|
||||
componentDidUpdate(prevProps: Props) {
|
||||
const { fetchChangesetIfNeeded, repository, id } = this.props;
|
||||
if (prevProps.id !== id) {
|
||||
fetchChangesetIfNeeded(repository, id);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -79,6 +79,7 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
const loading = isFetchChangesetPending(state, repository, id);
|
||||
const error = getFetchChangesetFailure(state, repository, id);
|
||||
return {
|
||||
id,
|
||||
changeset,
|
||||
error,
|
||||
loading
|
||||
|
||||
Reference in New Issue
Block a user