From 56b6db9277343c50d4ad45b1171b7a8d65afd511 Mon Sep 17 00:00:00 2001 From: vinceh121 Date: Sat, 1 Nov 2025 23:27:58 +0100 Subject: [PATCH] fix: ttag doesn't support typescript expressions --- assets/pages/search/DomainSearchPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/pages/search/DomainSearchPage.tsx b/assets/pages/search/DomainSearchPage.tsx index 9384ddd..0c8d1e5 100644 --- a/assets/pages/search/DomainSearchPage.tsx +++ b/assets/pages/search/DomainSearchPage.tsx @@ -18,6 +18,7 @@ import WatchlistSelectionModal from '../../components/tracking/watchlist/Watchli export default function DomainSearchPage() { const {query} = useParams() const [domain, setDomain] = useState() + const domainLdhName = domain?.ldhName const [loading, setLoading] = useState(false) const [addToWatchlistModal, setAddToWatchlistModal] = useState(false) @@ -47,7 +48,9 @@ export default function DomainSearchPage() { const addToWatchlist = async (watchlist: Watchlist) => { await addDomainToWatchlist(watchlist, domain!.ldhName).then(() => { setAddToWatchlistModal(false) - messageApi.success(t`${domain?.ldhName} added to ${watchlist.name}`) + + const ldhName = domain?.ldhName + messageApi.success(t`${ldhName} added to ${watchlist.name}`) }).catch((e: AxiosError) => { showErrorAPI(e, messageApi) }) @@ -86,7 +89,7 @@ export default function DomainSearchPage() { open={addToWatchlistModal} onFinish={addToWatchlist} modalProps={{ - title: t`Add ${domain?.ldhName} to a watchlist`, + title: t`Add ${domainLdhName} to a watchlist`, onCancel: () => setAddToWatchlistModal(false), onClose: () => setAddToWatchlistModal(false), }}