Fixes collection notification urls (#39127)

This commit is contained in:
Echo authored and GitHub committed 2026-05-21 13:17:35 +00:00
1 parent dc3ffac4a2
commit 6735902c1a
5 files changed
+32 -19

No files matched your search

@@ -1,6 +1,6 @@
import { useCallback, useMemo } from 'react';
import type { List } from 'immutable';
import type { List, Map } from 'immutable';
import { EmojiHTML } from '@/mastodon/components/emoji/html';
import { useElementHandledLink } from '@/mastodon/components/status/handled_link';
@@ -23,8 +23,19 @@ export const EmbeddedStatusContent: React.FC<{
},
[mentions],
);
const hrefToCollection = useCallback(
(href: string) => {
const collections = status.get('tagged_collections') as List<
Map<'url' | 'id', string>
>;
const collection = collections.find((item) => item.get('url') === href);
return collection?.get('id');
},
[status],
);
const htmlHandlers = useElementHandledLink({
hashtagAccountId: status.get('account') as string | undefined,
hrefToCollectionId: hrefToCollection,
hrefToMention,
});