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
feat: add a search field to server bans #579
Conversation
True and holy in nature. EGN 12/10 |
Conflicting |
not anymore |
src/pages/settings/server/Bans.tsx
Outdated
data.users | ||
.find( | ||
(u) => | ||
u._id == data.bans[index]._id.user, | ||
) | ||
?.username.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big performance penalty which should be memo-ized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useMemo
, useCallback
just prevents the function from being recreated, while useMemo
keeps the result between renders and also you don't call it every time you render an item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
Please make sure to check the following tasks before opening and submitting a PR
Adds a search bar to the server ban list:
(I copypasted the search bar from the member list, hence the lack of localization)