Skip to content

Chore: Hooks app/views/UserNotificationPreferenceView#4502

Merged
reinaldonetof merged 4 commits into
developfrom
chore.hooks-usernotificationpreferences
Sep 22, 2022
Merged

Chore: Hooks app/views/UserNotificationPreferenceView#4502
reinaldonetof merged 4 commits into
developfrom
chore.hooks-usernotificationpreferences

Conversation

@reinaldonetof

Copy link
Copy Markdown
Contributor

Proposed changes

Chore: Hooks app/views/UserNotificationPreferenceView

Issue(s)

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

value ? OPTIONS[preference].find(option => option.value === value) : OPTIONS[preference][0]
);

const getOptions = () =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this really need to be a method?
Wouldn't a simple constant work?

Because from what I understand what changes is the preference, if it is fixed, there could even be a memo to avoid doing this every time you have a render.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeap, will work if will be only a constant, however, every time the Picker re-render, will trigger a map, but this map we only need when opening the action sheet. So, instead of do a map every re-render, we are trigger the map only when we try to open the showActionSheet

Comment thread app/views/UserNotificationPreferencesView/index.tsx Outdated
Comment thread app/views/UserNotificationPreferencesView/index.tsx Outdated
@reinaldonetof reinaldonetof merged commit b3a2863 into develop Sep 22, 2022
@reinaldonetof reinaldonetof deleted the chore.hooks-usernotificationpreferences branch September 22, 2022 21:31
diegolmello pushed a commit that referenced this pull request Sep 28, 2022
* Chore: Hooks app/views/UserNotificationPreferenceView

* added trycatch and userId

Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
ivnxyz pushed a commit to NextiaDev/Rocket.Chat.ReactNative that referenced this pull request May 26, 2023
* Chore: Hooks app/views/UserNotificationPreferenceView

* added trycatch and userId

Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
ivnxyz pushed a commit to NextiaDev/Rocket.Chat.ReactNative that referenced this pull request May 26, 2023
* Chore: Hooks app/views/UserNotificationPreferenceView

* added trycatch and userId

Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants