Fix Consolidated Travel Billing toggle lock icon flashing while loading#95648
Draft
allgandalf wants to merge 2 commits into
Draft
Fix Consolidated Travel Billing toggle lock icon flashing while loading#95648allgandalf wants to merge 2 commits into
allgandalf wants to merge 2 commits into
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
The Consolidated Travel Billing toggle flashes a lock icon during the enable flow (turn on, connect bank, pick settlement account, "Got it") and on plain Travel page loads.
Switchrenders the lock whenever the toggle isdisabled, and the toggle'sdisabledincludedisLoading.openPolicyTravelPagepulsescardSettings.isLoadingtrue then false on every page focus (it runs in auseFocusEffect), plus the configure and settlement-account round-trips, so the lock blinked on/off with each loading pulse.showLockIconalready leftisLoadingout on purpose, butdisabledre-added it.Pulled
isLoadingout of the toggle'sdisabledso the lock is driven only by the stable reasons (!canWriteMoreFeatures || isOnWaitlist || hasOutstandingBalance). Added an earlyif (isLoading) returninhandleToggleso the toggle still can't be flipped mid-request, since that is the only thingdisabledwas doing there (pendingActiondoes not block presses). LeftisOnWaitliston the lock, it is a real eligibility-failure state and only changes on provisioning, not a per-load pulse.Fixed Issues
$ #94909
PROPOSAL:
Tests
Offline tests
The lock is derived from the Travel Invoicing card settings already in Onyx, so it renders the same offline. An outstanding balance still shows the lock offline, and a loading pulse never shows one.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari