From: derek Date: Mon, 13 Jul 2020 04:20:36 +0000 (-0400) Subject: ui.components.main: simplify url update logic X-Git-Url: http://these/git/%22https:/image.com/%7B%7D/static/%22%7Burl%7D/%7Burl%7D?a=commitdiff_plain;h=602993ac761e1d1bacbb0acb8d1fdc3625828acf;p=lemmy.git ui.components.main: simplify url update logic --- diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 3946132f..0460a639 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -271,14 +271,12 @@ export class Main extends Component { }) { const listingTypeStr = paramUpdates.listing_type || - ListingType[getListingTypeFromProps(this.props)].toLowerCase(); + ListingType[this.state.listingType].toLowerCase(); const dataTypeStr = - paramUpdates.data_type || - DataType[getDataTypeFromProps(this.props)].toLowerCase(); + paramUpdates.data_type || DataType[this.state.dataType].toLowerCase(); const sortStr = - paramUpdates.sort || - SortType[getSortTypeFromProps(this.props)].toLowerCase(); - const page = paramUpdates.page || getPageFromProps(this.props); + paramUpdates.sort || SortType[this.state.sort].toLowerCase(); + const page = paramUpdates.page || this.state.page; this.props.history.push( `/home/data_type/${dataTypeStr}/listing_type/${listingTypeStr}/sort/${sortStr}/page/${page}` );