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
pull/585/head
Lim Chee Aun 2024-06-26 17:26:41 +08:00
rodzic 1b3938f3d2
commit f7024f7723
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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) {