diff --git a/scm-ui/src/config/roles/containers/RepositoryRoles.js b/scm-ui/src/config/roles/containers/RepositoryRoles.js index 689c8cf1cc..2de1d3d74c 100644 --- a/scm-ui/src/config/roles/containers/RepositoryRoles.js +++ b/scm-ui/src/config/roles/containers/RepositoryRoles.js @@ -50,6 +50,26 @@ class RepositoryRoles extends React.Component { fetchRolesByPage(rolesLink, page); } + componentDidUpdate = (prevProps: Props) => { + const { + loading, + list, + page, + rolesLink, + location, + fetchRolesByPage + } = this.props; + if (list && page && !loading) { + const statePage: number = list.page + 1; + if (page !== statePage || prevProps.location.search !== location.search) { + fetchRolesByPage( + rolesLink, + page + ); + } + } + }; + render() { const { t, loading } = this.props;