From c26dff91e0cd2ac4d99339d8eb6718a0895a783e Mon Sep 17 00:00:00 2001 From: artsemkavaleu-deriv Date: Mon, 14 Feb 2022 12:55:17 +0300 Subject: [PATCH] fix validation chain in createAd() to show modal --- packages/p2p/src/components/my-ads/create-ad-form.jsx | 3 +++ packages/p2p/src/stores/my-ads-store.js | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/p2p/src/components/my-ads/create-ad-form.jsx b/packages/p2p/src/components/my-ads/create-ad-form.jsx index e79830c8df52..2f083ce8e974 100644 --- a/packages/p2p/src/components/my-ads/create-ad-form.jsx +++ b/packages/p2p/src/components/my-ads/create-ad-form.jsx @@ -47,6 +47,9 @@ const CreateAdForm = () => { JSON.stringify(should_not_show_auto_archive_message_again.current) ); my_ads_store.setIsAdCreatedModalVisible(false); + if (!my_ads_store.advert_details.is_visible) { + my_ads_store.setIsAdExceedsDailyLimitModalOpen(true); + } my_ads_store.setShowAdForm(false); }; diff --git a/packages/p2p/src/stores/my-ads-store.js b/packages/p2p/src/stores/my-ads-store.js index 5c39bc824b26..cffb52a03424 100644 --- a/packages/p2p/src/stores/my-ads-store.js +++ b/packages/p2p/src/stores/my-ads-store.js @@ -126,6 +126,7 @@ export default class MyAdsStore extends BaseStore { this.setApiErrorMessage(response.error.message); setSubmitting(false); } else if (should_not_show_auto_archive_message !== 'true' && this.adverts_archive_period) { + this.setAdvertDetails(response.p2p_advert_create); setTimeout(() => { if (!this.is_api_error_modal_visible) { this.setIsAdCreatedModalVisible(true);