Skip to content

[HOLD for payment 2023-11-17] [$250] Clean the usage of double onyx call on profile page #29165

@techievivek

Description

@techievivek

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)

// 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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorFirstPickEngineering only, please! Only add when there is an identified code solution.WeeklyKSv2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions