Skip to content

Commit

Permalink
fix one tag
Browse files Browse the repository at this point in the history
  • Loading branch information
simon louvet committed Jun 18, 2024
1 parent b59a564 commit 159fd9e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/Hit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<article key={hit.id} className="hit-item">
Expand Down Expand Up @@ -55,7 +61,7 @@ const Hit = ({ hit }) => {
)}
</div>

{hit.hasKeyword && hit._highlightResult && hit._highlightResult.hasKeyword && hit._highlightResult.hasKeyword.length > 0 && (
{hit?._highlightResult?.hasKeyword && (
<div className="hit-details">
<div className="hit-keyword">
<div className="hit-keyword-icon">
Expand Down

0 comments on commit 159fd9e

Please sign in to comment.