Skip to content

Workspaces - Update to USD popup is not dismissed dynamically if currency is updated #65015

Closed

Description

@vincdargento

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.1.71-8
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://github.com/Expensify/Expensify/issues/299830
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Default currency is different from USD
  1. Open the https://staging.new.expensify.com/ app and login on device 1
  2. Open the https://staging.new.expensify.com/ app on device 2 with the same user
  3. Open settings -> Workspaces -> Select the workspace from preconditions on both devices
  4. Click on Workflows
  5. Click on 'Connect bank account' button on device 1 to trigger 'Update to USD' popup
  6. On device 2, change currency to USD, clicking on Default currency in Profile
  7. Go to device 1

Expected Result:

App should dynamically dismiss 'Update to USD' popup if currency is updated to USD

Actual Result:

Update to USD popup is not dismissed dynamically if currency is updated

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 26, 2025
  2. melvin-bot commented on Jun 26, 2025

    @melvin-bot

    Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. mkzie2 commented on Jun 26, 2025

    @mkzie2
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Update to USD popup is not dismissed dynamically if currency is updated

    What is the root cause of that problem?

    The auto dismiss USD popup logic was removed here then it doesn't work now.

    What changes do you think we should make in order to solve the problem?

    1. We can update useDismissModalForUSD hook to support CONST.BETAS.GLOBAL_REIMBURSEMENTS_ON_ND and also auto dismiss this modal if the currency is supported. We can also change the name of the hook to more useful.
    function useDismissModalForUSD(workspaceCurrency: string | undefined, isGlobalReimbursementsOnNDBetaEnabled: boolean): [isCurrencyModalOpen: boolean, setIsCurrencyModalOpen: Dispatch<SetStateAction<boolean>>] {
        const [isCurrencyModalOpen, setIsCurrencyModalOpen] = useState(false);
    
        useEffect(() => {
            if (!isCurrencyModalOpen || !workspaceCurrency || !isCurrencySupportedForGlobalReimbursement(workspaceCurrency as CurrencyType, isGlobalReimbursementsOnNDBetaEnabled)) {
                return;
            }
    
            setIsCurrencyModalOpen(false);
        }, [workspaceCurrency, isCurrencyModalOpen, setIsCurrencyModalOpen, isGlobalReimbursementsOnNDBetaEnabled]);
    
        return [isCurrencyModalOpen, setIsCurrencyModalOpen];
    }
    
    export default useDismissModalForUSD;
    

    function useDismissModalForUSD(workspaceCurrency: string | undefined): [isCurrencyModalOpen: boolean, setIsCurrencyModalOpen: Dispatch<SetStateAction<boolean>>] {

    1. Then we can use it here and other places that have the confirm currency modal
    const [isUpdateWorkspaceCurrencyModalOpen, setIsUpdateWorkspaceCurrencyModalOpen] = useDismissModalForUSD(policy?.outputCurrency, isBetaEnabled(CONST.BETAS.GLOBAL_REIMBURSEMENTS_ON_ND));
    

    const [isUpdateWorkspaceCurrencyModalOpen, setIsUpdateWorkspaceCurrencyModalOpen] = useState(false);

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Update useDismissModalForUSD unit test to cover the new case

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. melvin-bot commented on Jun 30, 2025

    @melvin-bot

    @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. melvin-bot commented on Jul 1, 2025

    @melvin-bot

    @adelekennedy Eep! 4 days overdue now. Issues have feelings too...

  6. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    @adelekennedy Still overdue 6 days?! Let's take care of this!

  7. melvin-bot commented on Jul 7, 2025

    @melvin-bot

    @adelekennedy 10 days overdue. Is anyone even seeing these? Hello?

  8. adelekennedy commented on Jul 8, 2025

    @adelekennedy
    Contributor

    this is really difficult for me to reproduce - closing as this is a bit of an edge case

  9. mkzie2 commented on Jul 8, 2025

    @mkzie2
    Contributor

    @adelekennedy This bug was fixed here and it happens again now. I think we should fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions