From 8e68afbc79dee411376a1d0df2a234942b621f6e Mon Sep 17 00:00:00 2001 From: Thomas Junk Date: Tue, 28 Nov 2023 15:15:28 +0100 Subject: [PATCH] fix: If only 1 vulnerability is available display it openly --- .../vulnerabilities/vulnerability/Vulnerability.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/singleview/vulnerabilities/vulnerability/Vulnerability.svelte b/src/lib/singleview/vulnerabilities/vulnerability/Vulnerability.svelte index 0f8d895..3bf3ee1 100644 --- a/src/lib/singleview/vulnerabilities/vulnerability/Vulnerability.svelte +++ b/src/lib/singleview/vulnerabilities/vulnerability/Vulnerability.svelte @@ -35,10 +35,13 @@ } let header = vulnerability.cve ? vulnerability.cve : `Vulnerability ${index}`; let open = false; - $: if ($appStore.ui.selectedCVE === vulnerability.cve) { + $: if ($appStore.doc?.vulnerabilities && $appStore.doc?.vulnerabilities.length === 1) { + open = true; + } + $: if ($appStore.ui.selectedCVE && $appStore.ui.selectedCVE === vulnerability.cve) { open = true; updateUI(); - } else { + } else if ($appStore.ui.selectedCVE && $appStore.ui.selectedCVE !== vulnerability.cve) { open = false; }