From 04c9bf019701fbff372df354c57f9182723f032b Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Thu, 14 Mar 2024 17:25:48 +0800 Subject: [PATCH] Fixed empty state flashing issue on offers list (#19863) ref DES-101, DES-105 --- .../src/components/settings/growth/offers/OffersIndex.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx index ba528bc0a2..37465b6770 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx @@ -93,7 +93,7 @@ export const CopyLinkButton: React.FC<{offerCode: string}> = ({offerCode}) => { export const OffersIndexModal = () => { const modal = useModal(); const {updateRoute} = useRouting(); - const {data: {offers: allOffers = []} = {}} = useBrowseOffers({ + const {data: {offers: allOffers = []} = {}, isFetching: isFetchingOffers} = useBrowseOffers({ searchParams: { limit: 'all' } @@ -260,13 +260,13 @@ export const OffersIndexModal = () => { - {selectedTab === 'active' && activeOffers.length === 0 ? + {selectedTab === 'active' && activeOffers.length === 0 && !isFetchingOffers ? No offers found. : null } - {selectedTab === 'archived' && archivedOffers.length === 0 ? + {selectedTab === 'archived' && archivedOffers.length === 0 && !isFetchingOffers ? No offers found. :