Skip to content

Commit

Permalink
fix: incorrect current page of search paginator (#106)
Browse files Browse the repository at this point in the history
close AlistGo/alist#4974
Co-authored-by: Andy Hsu <[email protected]>
  • Loading branch information
itsHenry35 authored Aug 9, 2023
1 parent 9653256 commit dc09b46
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pages/home/folder/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const SearchResult = (props: { node: SearchNode; keywords: string }) => {
}

const Search = () => {
const pageSize = 100
const { isOpen, onOpen, onClose, onToggle } = createDisclosure()
const t = useT()
const handler = (name: string) => {
Expand Down Expand Up @@ -219,6 +220,7 @@ const Search = () => {
password(),
scope(),
page,
pageSize,
)
handleResp(resp, (data) => {
const content = data.content
Expand Down Expand Up @@ -304,15 +306,13 @@ const Search = () => {
{(item) => <SearchResult node={item} keywords={keywords()} />}
</For>
</VStack>
<Show when={data().total > 0}>
<Paginator
total={data().total}
defaultPageSize={100}
onChange={(page) => {
search(page)
}}
/>
</Show>
<Paginator
total={data().total}
defaultPageSize={pageSize}
onChange={(page) => {
search(page)
}}
/>
</VStack>
</ModalBody>
</ModalContent>
Expand Down

0 comments on commit dc09b46

Please sign in to comment.