From 7e965e56b45127ccd3555a6474947b87555bcebb Mon Sep 17 00:00:00 2001 From: Mitrasish Mukherjee Date: Fri, 21 Jan 2022 14:34:22 +0530 Subject: [PATCH 1/2] feat: fix domain latest link update --- .../DomainManagement/components/DomainItem/DomainItem.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx b/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx index d6f06c65..ba3191ee 100644 --- a/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx +++ b/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx @@ -84,7 +84,9 @@ const DomainItem: React.FC = ({ orgId: selectedOrg?._id, name: editDomainName !== domain ? editDomainName : undefined, link: - deployedSite !== link && deployedSite !== "latest" + deployedSite === "latest" + ? (sortedDeployments || [{ sitePreview: "" }])[0].sitePreview || "" + : deployedSite !== link ? deployedSite : undefined, isLatest, From 2854b6f5d6de5d631be6885e5a87c75346169db9 Mon Sep 17 00:00:00 2001 From: Mitrasish Mukherjee Date: Fri, 21 Jan 2022 15:47:55 +0530 Subject: [PATCH 2/2] feat: updates latest deployment site logic for domain --- .../DomainManagement/components/DomainItem/DomainItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx b/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx index ba3191ee..04ac4eec 100644 --- a/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx +++ b/src/components/Sites/routes/DomainManagement/components/DomainItem/DomainItem.tsx @@ -85,7 +85,7 @@ const DomainItem: React.FC = ({ name: editDomainName !== domain ? editDomainName : undefined, link: deployedSite === "latest" - ? (sortedDeployments || [{ sitePreview: "" }])[0].sitePreview || "" + ? (sortedDeployments || [{ sitePreview: undefined }])[0]?.sitePreview : deployedSite !== link ? deployedSite : undefined,