Skip to content

Commit

Permalink
Stats: Fetch purchases before the notice is rendered (#81052)
Browse files Browse the repository at this point in the history
  • Loading branch information
dognose24 authored Aug 25, 2023
1 parent 1a50a7e commit 4cf8aec
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions client/my-sites/stats/stats-notices/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ const NewStatsNotices = ( { siteId, isOdysseyStats, statsPurchaseSuccess }: Stat
// TODO: The dismiss logic could potentially be extracted too.
return (
<>
{ /* Only query site purchases on Calypso via existing data component */ }
{ ! isOdysseyStats && <QuerySitePurchases siteId={ siteId } /> }
{ ALL_STATS_NOTICES.map(
( notice ) =>
calculatedNoticesVisibility[ notice.noticeId ] && (
Expand Down Expand Up @@ -137,10 +135,14 @@ export default function StatsNotices( {
}

return (
<NewStatsNotices
siteId={ siteId }
isOdysseyStats={ isOdysseyStats }
statsPurchaseSuccess={ statsPurchaseSuccess }
/>
<>
{ /* Only query site purchases on Calypso via existing data component */ }
{ ! isOdysseyStats && <QuerySitePurchases siteId={ siteId } /> }
<NewStatsNotices
siteId={ siteId }
isOdysseyStats={ isOdysseyStats }
statsPurchaseSuccess={ statsPurchaseSuccess }
/>
</>
);
}

0 comments on commit 4cf8aec

Please sign in to comment.