Repository navigation
Description
Problem
We currently have used a double onyx call on the profile page to subscribe to the DM chat report in order for notification preference to update correctly for the profile page. This was reported during PR review here: #28200 (comment)
Lines 306 to 317 in a63f853
| // eslint-disable-next-line rulesdir/no-multiple-onyx-in-file | |
| withOnyx({ | |
| report: { | |
| key: ({route, session}) => { | |
| const accountID = Number(lodashGet(route.params, 'accountID', 0)); | |
| if (Number(session.accountID) === accountID || Session.isAnonymousUser()) { | |
| return null; | |
| } | |
| return `${ONYXKEYS.COLLECTION.REPORT}${lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', '')}`; | |
| }, | |
| }, | |
| }), |
Discussed here: #28200 (comment)
Why is this important?
Using a double Onyx subscription for any component is not a recommended practice so it would be nice to clean that up. Moreover, we have now enabled the notification preference option for all the chat reports so maybe we can create a separate component for the notification preference page and reuse that across various pages.
Solution
Create a separate component for notification preference and get rid of the double onyx call on the profile page. Feel free to come up with your own solutions.
Here is a potential solution to the problem: #28200 (comment)
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~013768a6222352d168
- Upwork Job ID: 1711676109112000512
- Last Price Increase: 2023-10-24
- Automatic offers:
- pradeepmdk | Contributor | 27435339
Activity
melvin-bot commentedon Oct 10, 2023
Job added to Upwork: https://www.upwork.com/jobs/~013768a6222352d168
melvin-bot commentedon Oct 10, 2023
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 10, 2023
melvin-bot commentedon Oct 10, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu (
External)techievivek commentedon Oct 10, 2023
Bug0 triage checklist is not required for this GH, as this is just a code improvement issue.
alexxxwork commentedon Oct 10, 2023
Is it available without a proposal? I would like to take it.
45 remaining items
melvin-bot commentedon Nov 10, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
pradeepmdk commentedon Nov 21, 2023
bump for payment
pradeepmdk commentedon Nov 25, 2023
@johncschuster bump for payment
techievivek commentedon Dec 4, 2023
Gentle bump @johncschuster ^
burczu commentedon Dec 11, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
This was just refactor of an existing feature.
n/a
n/a
As this was just a refactor, I guess we should expect regression tests for this feature: #27394 should cover testing this issue.
pradeepmdk commentedon Dec 13, 2023
@johncschuster bump for payment
pradeepmdk commentedon Dec 16, 2023
@techievivek can u help me for payment here
johncschuster commentedon Dec 18, 2023
Sorry I dropped the ball, @pradeepmdk. I'll get payment issued this morning.
pradeepmdk commentedon Dec 18, 2023
Thank you @johncschuster
johncschuster commentedon Dec 18, 2023
Payment has been issued! Thanks for your patience!