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

feat: add a search field to server bans #579

Closed
wants to merge 4 commits into from
Closed

Conversation

sussycatgirl
Copy link
Member

Please make sure to check the following tasks before opening and submitting a PR

  • I understand and have followed the contribution guide
  • I have tested my changes locally and they are working as intended
  • These changes do not have any notable side effects on other Revolt projects
  • (optional) I have opened a pull request on the translation repository
  • I have included screenshots to demonstrate my changes

Adds a search bar to the server ban list:
image

(I copypasted the search bar from the member list, hence the lack of localization)

@EnokiUN
Copy link

EnokiUN commented Apr 10, 2022

True and holy in nature.

EGN 12/10

EnokiUN
EnokiUN previously approved these changes Apr 10, 2022
@insertish
Copy link
Member

Conflicting

@sussycatgirl
Copy link
Member Author

Conflicting

not anymore :trollface:

Comment on lines 88 to 93
data.users
.find(
(u) =>
u._id == data.bans[index]._id.user,
)
?.username.toLowerCase()
Copy link
Member

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.

Copy link
Member Author

@sussycatgirl sussycatgirl May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

@insertish insertish mentioned this pull request May 8, 2022
6 tasks
@insertish insertish closed this in eb1bd27 May 8, 2022
@Rexogamer Rexogamer deleted the jan-bansearchbar branch May 8, 2022 11:34
lynxize pushed a commit to lynxize/revite-nonsense that referenced this pull request Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants