Part 10: Remove usages of Onyx.connect for ONYXKEYS.SESSION in src/libs/SubscriptionUtils#92517
Part 10: Remove usages of Onyx.connect for ONYXKEYS.SESSION in src/libs/SubscriptionUtils#92517marufsharifi wants to merge 5 commits into
Conversation
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| iouRequestBackToReport, | ||
| unreportedExpenseBackToReport, | ||
| lastDistanceExpenseType, | ||
| currentUserAccountID, |
There was a problem hiding this comment.
@marufsharifi Make this param as required. And remove the null fallback from the function
| import {isPaidGroupPolicy} from './PolicyUtils'; | ||
| import {shouldRestrictUserBillableActions} from './SubscriptionUtils'; | ||
|
|
||
| function shouldUseDefaultExpensePolicy( |
There was a problem hiding this comment.
@marufsharifi Make currentUserAccountID as required here too
There was a problem hiding this comment.
| currentUserAccountID: number, |
There was a problem hiding this comment.
Use useCurrentUserPersonalDetails hook here for accountID
There was a problem hiding this comment.
| currentUserAccountID: number; |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
|
@shubham1206agra, Addressed, could you please take another look. thanks |
| const [isActionLoading] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${reportItem.reportID}`, {selector: isActionLoadingSelector}); | ||
| const expensifyIcons = useMemoizedLazyExpensifyIcons(['DotIndicator']); | ||
| const currentUserDetails = useCurrentUserPersonalDetails(); | ||
| const {accountID: currentUserAccountID, email: currentUserEmail} = useCurrentUserPersonalDetails(); |
There was a problem hiding this comment.
| const {accountID: currentUserAccountID, email: currentUserEmail} = useCurrentUserPersonalDetails(); | |
| const currentUserDetails = useCurrentUserPersonalDetails(); |
@marufsharifi Use it like this only
Explanation of Change
Part 10: Remove usages of
Onyx.connectforONYXKEYS.SESSIONby making the function more pure:shouldRestrictUserBillableActionsFixed Issues
$ #66442
PROPOSAL: N/A
Tests
Spend > Expenses.Move to report>Create report/Change report.Flow-2
Spend > Expenses.Move to report>Create report/Change report.Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Flow 1:
Screen.Recording.2026-06-04.at.2.07.58.PM.mov
Flow 2:
Screen.Recording.2026-06-04.at.2.09.20.PM.mov