From d935cc0bb6d781b487c32ab4e99b2cfef086f372 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Tue, 20 Feb 2024 17:29:00 +0100 Subject: [PATCH] fixed tag handling for items comming with tag property --- src/Components/Map/Layer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/Map/Layer.tsx b/src/Components/Map/Layer.tsx index bdb20bf6..4686c8ac 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -14,6 +14,7 @@ import { useLocation } from 'react-router-dom'; import { getValue } from '../../Utils/GetValue' import { hashTagRegex } from '../../Utils/HashTagRegex' import { randomColor } from '../../Utils/RandomColor' +import { encodeTag } from '../../Utils/FormatTags' export const Layer = ({ data, @@ -149,8 +150,8 @@ export const Layer = ({ if (item?.tags) { item[itemTextField] = item[itemTextField] + '\n\n'; item.tags.map(tag => { - if (!item[itemTextField].includes(`#${tag}`)) - return (item[itemTextField] = item[itemTextField] + `#${tag} `) + if (!item[itemTextField].includes(`#${encodeTag(tag)}`)) + return (item[itemTextField] = item[itemTextField] + `#${encodeTag(tag)} `) return item[itemTextField] });