From f7024f77234023e5e07e59a17531e01aa62fa3d7 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 26 Jun 2024 17:26:41 +0800 Subject: [PATCH] Only allow trending link posts for current instance, not remote instance For this to work on remote instance, will need to fetch its version and check first --- src/pages/trending.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/trending.jsx b/src/pages/trending.jsx index 1b85de77..670e30d4 100644 --- a/src/pages/trending.jsx +++ b/src/pages/trending.jsx @@ -72,6 +72,8 @@ function Trending({ columnMode, ...props }) { // const navigate = useNavigate(); const latestItem = useRef(); + const sameCurrentInstance = instance === currentInstance; + const [hashtags, setHashtags] = useState([]); const [links, setLinks] = useState([]); const trendIterator = useRef(); @@ -137,7 +139,8 @@ function Trending({ columnMode, ...props }) { const [currentLink, setCurrentLink] = useState(null); const hasCurrentLink = !!currentLink; const currentLinkRef = useRef(); - const supportsTrendingLinkPosts = supports('@mastodon/trending-hashtags'); + const supportsTrendingLinkPosts = + sameCurrentInstance && supports('@mastodon/trending-hashtags'); useEffect(() => { if (currentLink && currentLinkRef.current) {