From 737639ae846ab84d774bcffcac0cebe5d6f475bb Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 19 Aug 2023 23:38:22 +0100 Subject: [PATCH] Updates the UI for threats from Google Safe Browsing --- src/components/Results/Threats.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/Results/Threats.tsx b/src/components/Results/Threats.tsx index a892eaf..1a77123 100644 --- a/src/components/Results/Threats.tsx +++ b/src/components/Results/Threats.tsx @@ -32,13 +32,17 @@ const convertToDate = (dateString: string): string => { } const MalwareCard = (props: {data: any, title: string, actionButtons: any }): JSX.Element => { - const urlHaus = props.data.urlHaus; - const phishTank = props.data.phishTank; - const cloudmersive = props.data.cloudmersive; + const urlHaus = props.data.urlHaus || {}; + const phishTank = props.data.phishTank || {}; + const cloudmersive = props.data.cloudmersive || {}; + const safeBrowsing = props.data.safeBrowsing || {}; return ( - { cloudmersive && !cloudmersive.error && ( - + { safeBrowsing && !safeBrowsing.error && ( + + )} + { ((cloudmersive && !cloudmersive.error) || safeBrowsing?.details) && ( + )} { phishTank && !phishTank.error && (