Closed sum117 closed 1 year ago
Why does spam pressing the button cause this?
This is caused because the API is updating the value of the page number before the application can handle the disable event on the previous/forward button.
This check below Get Page
is what causes this. It was missing the guard for negative/exceeded page numbers from the very start.
This is caused because the API is updating the value of the page number before the application can handle the disable event on the previous/forward button.
This check below
Get Page
is what causes this. It was missing the guard for negative/exceeded page numbers from the very start.
I do not feel that currentPage
should ever be less than 0, if this is not coming from the api, then the guard of protecting that i do not feel is the solution, the solution is figuring out WHY the framework can not keep up with the updating from the API and prevent the issue from the source.
this guard is fine, but now we have a sitauton where this.currentPage
can be <0 and this doesn't feel right
I can't imagine a situation where you'd want the index to be -1. But yeah, I've seen this issue before in other pagination systems and it's always been like that. If there's multiple people clicking it over and over the application can't handle it.
I can't imagine a situation where you'd want the index to be -1. But yeah, I've seen this issue before in other pagination systems and it's always been like that. If there's multiple people clicking it over and over the application can't handle it.
that concern is valid, but then there should be some methods to tackle this. I have following suggestions.
Changes have been made.
Removed function, added two if statements
@sum117 rebase with signed commit.
Please describe the changes this PR makes and why it should be merged: This is a simple fix for an issue caused by spam clicking buttons. The application will crash if this is not implemented all the times if the clicks have a short interval between them. The best scenario to describe this is multiple users clicking the button at the same time (which happened on my server).
Package