Skip to content

Commit

Permalink
Merge pull request #21873 from Pujan92/fix/21570
Browse files Browse the repository at this point in the history
Fix: Update to USD popup is not dismissed dynamically if currency is updated
  • Loading branch information
Li357 authored Jun 30, 2023
2 parents 12e9718 + b5f0e01 commit e840a1d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/workspace/WorkspaceInitialPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'underscore';
import lodashGet from 'lodash/get';
import React, {useCallback, useState} from 'react';
import React, {useCallback, useEffect, useState} from 'react';
import {View, ScrollView} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -82,6 +82,13 @@ function WorkspaceInitialPage(props) {
Navigation.navigate(ROUTES.SETTINGS_WORKSPACES);
}, [props.reports, policy]);

useEffect(() => {
if (!isCurrencyModalOpen || policy.outputCurrency !== CONST.CURRENCY.USD) {
return;
}
setIsCurrencyModalOpen(false);
}, [policy.outputCurrency, isCurrencyModalOpen]);

/**
* Call update workspace currency and hide the modal
*/
Expand Down

0 comments on commit e840a1d

Please sign in to comment.