From 159fd9e9b5c17a3e18d1bce7757bc8b8c102ac01 Mon Sep 17 00:00:00 2001 From: simon louvet Date: Tue, 18 Jun 2024 18:37:12 +0200 Subject: [PATCH] fix one tag --- frontend/src/components/Hit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Hit.js b/frontend/src/components/Hit.js index df99bff..6301547 100644 --- a/frontend/src/components/Hit.js +++ b/frontend/src/components/Hit.js @@ -7,6 +7,12 @@ import { ReactComponent as TagIcon } from '../assets/logos/common/SVG/tag.svg'; import { ReactComponent as RessourceIcon } from '../assets/logos/common/SVG/ressource.svg'; const Hit = ({ hit }) => { + console.log(hit); + if (hit.hasKeyword && !Array.isArray(hit.hasKeyword)) { + hit.hasKeyword = [hit.hasKeyword]; + hit._highlightResult.hasKeyword = [hit._highlightResult.hasKeyword]; + hit._snippetResult.hasKeyword = [hit._snippetResult.hasKeyword]; + } return ( <>
@@ -55,7 +61,7 @@ const Hit = ({ hit }) => { )} - {hit.hasKeyword && hit._highlightResult && hit._highlightResult.hasKeyword && hit._highlightResult.hasKeyword.length > 0 && ( + {hit?._highlightResult?.hasKeyword && (