Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Incorrect current page of search paginator #106

Merged
merged 2 commits into from Aug 9, 2023
Merged

fix: Incorrect current page of search paginator #106

merged 2 commits into from Aug 9, 2023

Conversation

itsHenry35
Copy link
Member

before:
image

after:
image

@netlify
Copy link

netlify bot commented Aug 9, 2023

Deploy Preview for alist-web ready!

Name Link
🔨 Latest commit 181e170
🔍 Latest deploy log https://app.netlify.com/sites/alist-web/deploys/64d336871d6fb8000891f88f
😎 Deploy Preview https://deploy-preview-106--alist-web.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@itsHenry35 itsHenry35 changed the title fix: incorrect current search paginator fix: Incorrect current page of search paginator Aug 9, 2023
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Aug 9, 2023
@xhofe xhofe merged commit dc09b46 into alist-org:main Aug 9, 2023
6 checks passed
@itsHenry35
Copy link
Member Author

itsHenry35 commented Aug 9, 2023

@xhofe The "simplify code" needs to be reverted, your code still has an issue which my initial code didn't have
for example, if you search "a" and navigate to the sixth page, the result is correct for the "a" result's sixth page, however, when you search "b", the paginator still shows 6 while the result for "b" is the first page. That's what this line of code was for: https://github.com/itsHenry35/alist-web/blob/1544f13f044f679bbd588f384a55bedcbc6e52c7/src/pages/home/folder/Search.tsx#L212
I think my code has already been the most simplified

@itsHenry35
Copy link
Member Author

reproduction:
image
image
image

@xhofe
Copy link
Member

xhofe commented Aug 9, 2023

fine, I think we can make Paginator an optional controlled component, or give a reset callback

@itsHenry35
Copy link
Member Author

itsHenry35 commented Aug 9, 2023

fine, I think we can make Paginator an optional controlled component, or give a reset callback

yeah but it's just not necessary because Show can be a way to reset the component

@itsHenry35
Copy link
Member Author

fine, I think we can make Paginator an optional controlled component, or give a reset callback

so now shall I create another PR to revert the commit or shall you implement a reset callback

@xhofe
Copy link
Member

xhofe commented Aug 9, 2023

I prefer to implement a reset callback or make Paginator an optional controlled component

Using Show to reset components looks unorthodox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants