From 14ada804311a6c55b8571188e8c28cac7b87762d Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 7 Jun 2024 20:31:19 +0100 Subject: [PATCH] fix: sideloaded addon pages not working due to update check --- src/features/marketplace/views/ItemPage.jsx | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/features/marketplace/views/ItemPage.jsx b/src/features/marketplace/views/ItemPage.jsx index 80ec728b..fda27d37 100644 --- a/src/features/marketplace/views/ItemPage.jsx +++ b/src/features/marketplace/views/ItemPage.jsx @@ -158,12 +158,15 @@ class ItemPage extends PureComponent { ); - const dateObj = new Date(this.props.data.data.updated_at); - const formattedDate = new Intl.DateTimeFormat(shortLocale, { - year: 'numeric', - month: 'long', - day: '2-digit', - }).format(dateObj); + let dateObj, formattedDate; + if (this.props.data.data.updated_at) { + dateObj = new Date(this.props.data.data.updated_at); + formattedDate = new Intl.DateTimeFormat(shortLocale, { + year: 'numeric', + month: 'long', + day: '2-digit', + }).format(dateObj); + } return ( <> @@ -292,11 +295,12 @@ class ItemPage extends PureComponent { {variables.getMessage('modals.main.marketplace.product.details')}
- {moreInfoItem( - , - variables.getMessage('modals.main.marketplace.product.updated_at'), - formattedDate, - )} + {this.props.data.data.updated_at && + moreInfoItem( + , + variables.getMessage('modals.main.marketplace.product.updated_at'), + formattedDate, + )} {this.props.data.data.quotes && moreInfoItem( ,