corrected remove unsupported query-feature commit

This commit is contained in:
Florian Scholdei
2019-05-17 17:04:04 +02:00
parent 15cb29e1fc
commit 1ee76d2c31

View File

@@ -50,6 +50,26 @@ class RepositoryRoles extends React.Component<Props> {
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;