Skip to content

Commit 6aba8ae

Browse files
authored
fix: hide redundant lottery section (#5492)
* fix: hide redundant lottery section * fix: remove redundant lottery section
1 parent 3fd6a2f commit 6aba8ae

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

sites/public/src/components/listing/ListingView.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -310,28 +310,19 @@ export const ListingView = (props: ListingProps) => {
310310
}
311311

312312
let lotterySection
313-
if (publicLottery && (!lotteryResults || (lotteryResults && !lotteryResults.url))) {
313+
314+
if (
315+
publicLottery &&
316+
(!lotteryResults || (lotteryResults && !lotteryResults.url)) &&
317+
(listing.status === ListingsStatusEnum.active || !lotteryResults)
318+
) {
314319
lotterySection = publicLottery.startDate && (
315320
<EventSection
316321
headerText={t("listings.publicLottery.header")}
317322
sectionHeader={true}
318323
events={[getEvent(publicLottery)]}
319324
/>
320325
)
321-
if (dayjs(publicLottery.startTime) < dayjs() && lotteryResults && !lotteryResults.url) {
322-
lotterySection = (
323-
<EventSection
324-
headerText={t("listings.lotteryResults.header")}
325-
sectionHeader={true}
326-
events={[
327-
getEvent(
328-
lotteryResults,
329-
lotteryResults.note || t("listings.lotteryResults.completeResultsWillBePosted")
330-
),
331-
]}
332-
/>
333-
)
334-
}
335326
}
336327

337328
const getReservedTitle = () => {

0 commit comments

Comments
 (0)