tods-competition-factory 2.1.22 → 2.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.1.22';
6
+ return '2.1.23';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -36309,8 +36309,8 @@ function participantScheduledMatchUps({ scheduleAttributes = ['scheduledDate', '
36309
36309
  }
36310
36310
 
36311
36311
  function getCompetitionPublishedDrawDetails({ tournamentRecords }) {
36312
- const drawIds = [];
36313
36312
  const detailsMap = {};
36313
+ const drawIds = [];
36314
36314
  for (const tournamentRecord of Object.values(tournamentRecords)) {
36315
36315
  for (const event of tournamentRecord.events ?? []) {
36316
36316
  const eventPubStatus = getEventPublishStatus({ event });
@@ -36593,9 +36593,7 @@ function competitionScheduleMatchUps(params) {
36593
36593
  }
36594
36594
  let publishedDrawIds, detailsMap;
36595
36595
  if (usePublishState) {
36596
- ({ drawIds: publishedDrawIds, detailsMap } = getCompetitionPublishedDrawDetails({
36597
- tournamentRecords,
36598
- }));
36596
+ ({ drawIds: publishedDrawIds, detailsMap } = getCompetitionPublishedDrawDetails({ tournamentRecords }));
36599
36597
  }
36600
36598
  if (publishedDrawIds?.length) {
36601
36599
  if (!params.contextFilters)
@@ -36655,7 +36653,7 @@ function competitionScheduleMatchUps(params) {
36655
36653
  contextFilters: params.contextFilters,
36656
36654
  });
36657
36655
  let relevantMatchUps = [...(upcomingMatchUps ?? []), ...(pendingMatchUps ?? [])];
36658
- if (detailsMap && Object.keys(detailsMap).length) {
36656
+ if (detailsMap && (!publishedDrawIds?.length || Object.keys(detailsMap).length)) {
36659
36657
  relevantMatchUps = relevantMatchUps.filter((matchUp) => {
36660
36658
  const { drawId, structureId, stage } = matchUp;
36661
36659
  if (!detailsMap?.[drawId]?.publishingDetail?.published)