fixes refetching loop for non existing changesets

This commit is contained in:
Sebastian Sdorra
2020-06-17 16:45:53 +02:00
parent 231d81992a
commit 808a8a4107
2 changed files with 8 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Close file lists in migration ([#1191](https://github.com/scm-manager/scm-manager/pull/1191))
- Use command in javahg.py from registrar (Upgrade to newer javahg version) ([#1192](https://github.com/scm-manager/scm-manager/pull/1192))
- Fixed wrong e-tag format ([sdorra/web-resource #1](https://github.com/sdorra/web-resources/pull/1))
- Fixed refetching loop for non existing changesets
## [2.0.0] - 2020-06-04
### Added

View File

@@ -48,16 +48,16 @@ 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;
componentDidUpdate(prevProps: Props) {
const { fetchChangesetIfNeeded, repository, id } = this.props;
if (prevProps.id !== id) {
fetchChangesetIfNeeded(repository, id);
}
}
render() {
const { changeset, loading, error, t, repository } = this.props;
@@ -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