diff --git a/src/short-urls/Paginator.js b/src/short-urls/Paginator.js index efd6c1ba..6463004e 100644 --- a/src/short-urls/Paginator.js +++ b/src/short-urls/Paginator.js @@ -2,7 +2,6 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; import { connect } from 'react-redux'; -import { updateShortUrlsList } from './reducers/shortUrlsList'; export class Paginator extends React.Component { render() { @@ -21,7 +20,6 @@ export class Paginator extends React.Component { this.updatePage(i)} > {i} @@ -39,7 +37,6 @@ export class Paginator extends React.Component { previous tag={Link} to={`/server/${serverId}/list-short-urls/${currentPage - 1}`} - onClick={() => this.updatePage(currentPage - 1)} /> {renderPages()} @@ -48,18 +45,11 @@ export class Paginator extends React.Component { next tag={Link} to={`/server/${serverId}/list-short-urls/${currentPage + 1}`} - onClick={() => this.updatePage(currentPage + 1)} /> ); } - - updatePage(page) { - this.props.updateShortUrlsList({ ...this.props.shortUrlsListParams, page }) - } } -export default connect(state => ({ - shortUrlsListParams: state.shortUrlsListParams, -}), { updateShortUrlsList })(Paginator); +export default connect()(Paginator); diff --git a/src/short-urls/ShortUrls.js b/src/short-urls/ShortUrls.js index fedcd9b8..503bd989 100644 --- a/src/short-urls/ShortUrls.js +++ b/src/short-urls/ShortUrls.js @@ -6,10 +6,14 @@ import './ShortUrls.scss'; import ShortUrlsList from './ShortUrlsList'; export function ShortUrls(props) { + const { match: { params } } = props; + // Using a key on a component makes react to create a new instance every time the key changes + const urlsListKey = `${params.serverId}_${params.page}`; + return (
- +
);