reset page to 1 on new search

This commit is contained in:
Asnxthaony 2022-02-12 18:04:49 +08:00
parent 3ebaf81880
commit ab58c86695
No known key found for this signature in database
GPG Key ID: B7D610EF03EA50F9

View File

@ -115,11 +115,15 @@ const SkinLibrary: React.FC = () => {
const handleFormSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
setKeyword(name)
setPage(1)
}
const handleLikesSortClick = () => setSort('likes')
const handleTimeSortClick = () => setSort('time')
const handleSelfUploadClick = () => setUploader(currentUid)
const handleSelfUploadClick = () => {
setUploader(currentUid)
setPage(1)
}
const handleResetClick = () => {
setFilter('skin')
setName('')
@ -129,7 +133,10 @@ const SkinLibrary: React.FC = () => {
setPage(1)
}
const handleUploaderClick = (uploader: number) => setUploader(uploader)
const handleUploaderClick = (uploader: number) => {
setUploader(uploader)
setPage(1)
}
const handleAddToCloset = async (item: LibraryItem, index: number) => {
if (!currentUid) {