Fix Photos page current page when changing filter
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
$: currentCountry = countries.find((country: any) => country.slug === filterCountry)
|
||||
|
||||
// Pages related informations
|
||||
let currentPage: number = 1
|
||||
let currentPage = 1
|
||||
let ended: boolean
|
||||
let currentPhotosAmount: number
|
||||
$: currentPhotosAmount = photos.length
|
||||
@@ -119,17 +119,20 @@
|
||||
// Country select
|
||||
const handleCountryChange = ({ detail: value }) => {
|
||||
filterCountry = value === defaultCountry ? defaultCountry : value
|
||||
currentPage = 1
|
||||
}
|
||||
|
||||
// Sort select
|
||||
const handleSortChange = ({ detail: value }) => {
|
||||
filterSort = value === defaultSort ? defaultSort : value
|
||||
currentPage = 1
|
||||
}
|
||||
|
||||
// Reset filters
|
||||
const resetFiltered = () => {
|
||||
filterCountry = defaultCountry
|
||||
filterSort = defaultSort
|
||||
currentPage = 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user