Remove initialValue from useOnyx hook#64735
Conversation
| const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); | ||
| const [downloadErrorModalVisible, setDownloadErrorModalVisible] = useState(false); | ||
| const [dismissedHoldUseExplanation, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {initialValue: true, canBeMissing: false}); | ||
| const [dismissedHoldUseExplanation = true, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {canBeMissing: false}); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Why the initial value was added here? Due to this issue: #37012
Updating the logic to use the default value creates a bug - Hold Request education modal never appears!
I've investigated it, and I think we can get rid of dismissedHoldUseExplanation initial value at all, since we have the check for isLoadingHoldUseExplained:
App/src/components/MoneyReportHeader.tsx
Lines 412 to 413 in 19b6dfa
When I remove initialValue it still works as expected.
…-useOnyx # Conflicts: # src/components/SelectionList/Search/TransactionGroupListItem.tsx
…-useOnyx # Conflicts: # src/components/MoneyRequestHeader.tsx # src/pages/settings/Profile/PersonalDetails/LegalNamePage.tsx # src/pages/settings/Profile/ProfileAvatar.tsx
|
Note: I haven't resolved errors from |
|
@alitoshmatov 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] |
|
@VickyStash Does this need reviewing, just confirming based on this:
|
@alitoshmatov Yeah, this one requires review, sorry for the confusion, I've updated the description! |
|
@VickyStash Reviewing right now, also can you resolve conflicts |
…-useOnyx # Conflicts: # src/pages/Search/SearchPage.tsx
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb Chromeonyx-mweb.moviOS: HybridApponyx-ios.mp4iOS: mWeb Safarionyx-safari.movMacOS: Chrome / Safarionyx-web-0.movMacOS: Desktoponyx-desktop-0.mov |
roryabraham
left a comment
There was a problem hiding this comment.
LGTM 👍🏼
I'm choosing to ignore the changed files lint for things like canBeMissing, just to maintain the low risk of this PR that changes a lot of files.
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Merging despite discussion of potential further refinements in Expensify/eslint-config-expensify#150, mostly to avoid conflicts. Not an emergency, see previous comment |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.1.79-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.79-11 🚀
|
Explanation of Change
Remove initialValue from useOnyx hook
Fixed Issues
$ #65022
PROPOSAL: N/A
Tests
Offline tests
Same, as in the Tests section
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same, as in the Tests section
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android: Native
android.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4