Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adrienne / Market rate change popup not displayed #7478

3 changes: 3 additions & 0 deletions packages/p2p/src/components/buy-sell/buy-sell-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const BuySellForm = props => {
if (is_market_rate_changed && rate_type === ad_type.FLOAT) {
showModal({
key: 'RateChangeModal',
props: {
currency: buy_sell_store.local_currency,
},
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useStores } from 'Stores';
import { useModalManagerContext } from 'Components/modal-manager/modal-manager-context';
import './rate-change-modal.scss';

const RateChangeModal = () => {
const RateChangeModal = ({ currency }) => {
const { floating_rate_store, general_store } = useStores();
const local_currency = general_store.client?.local_currency_config?.currency;
const local_currency = currency ?? general_store.client?.local_currency_config?.currency;
const { hideModal, is_modal_open } = useModalManagerContext();

const closeModal = () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/p2p/src/stores/buy-sell-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,14 @@ export default class BuySellStore extends BaseStore {
}

onLocalCurrencySelect(local_currency) {
const { floating_rate_store } = this.root_store;
this.setSelectedLocalCurrency(local_currency);
this.setLocalCurrency(local_currency);
this.setItems([]);
this.setIsLoading(true);
this.loadMoreItems({ startIndex: 0 });
floating_rate_store.previous_exchange_rate = null;
floating_rate_store.setIsMarketRateChanged(false);
}

registerIsListedReaction() {
Expand Down