From 2e91a63ca12ab02e6899133ffafa323b17ab6863 Mon Sep 17 00:00:00 2001 From: Timothy Le Bon Date: Wed, 20 Dec 2023 16:45:30 +0100 Subject: [PATCH] runfix: device modal update --- .../Modals/PrimaryModal/PrimaryModal.tsx | 2 +- .../Modals/PrimaryModal/PrimaryModalState.tsx | 28 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx b/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx index f0dfb4b084c..783d9f86bc0 100644 --- a/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx +++ b/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx @@ -233,7 +233,7 @@ export const PrimaryModalComponent: FC = () => { {message && (
- {message && } +
)} diff --git a/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx b/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx index f54088a1c8e..347b939b00f 100644 --- a/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx +++ b/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx @@ -158,24 +158,22 @@ const updateCurrentModalContent = (type: PrimaryModalType, options: ModalOptions content.titleText = t('modalAccountNewDevicesHeadline'); content.primaryAction = {...primaryAction, text: t('modalAcknowledgeAction')}; content.secondaryAction = {...secondaryAction, text: t('modalAccountNewDevicesSecondary')}; - const deviceList = (data as ClientNotificationData[]) - .map(device => { - const deviceDate = new Date(device.time); - const deviceTime = isValid(deviceDate) ? new Date(deviceDate) : new Date(); - const formattedDate = formatLocale(deviceTime, 'PP, p'); - const deviceModel = `${t('modalAccountNewDevicesFrom')} ${escape(device.model)}`; - return ( - <> -
${formattedDate} - UTC
-
${deviceModel}
- - ); - }) - .join(''); + const deviceList = (data as ClientNotificationData[]).map(device => { + const deviceDate = new Date(device.time); + const deviceTime = isValid(deviceDate) ? new Date(deviceDate) : new Date(); + const formattedDate = formatLocale(deviceTime, 'PP, p'); + const deviceModel = `${t('modalAccountNewDevicesFrom')} ${escape(device.model)}`; + return ( + <> +
{formattedDate} - UTC
+
{deviceModel}
+ + ); + }); content.message = ( <> +
{deviceList}
{t('modalAccountNewDevicesMessage')} -
${deviceList}
); break;