This commit is contained in:
Sebastian Hädrich 2025-06-26 03:51:02 +02:00 committed by GitHub
parent 1e672ae66e
commit f9f7018639
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,8 @@ interface TargetParams {
export const HashtagMenuController: React.FC = () => { export const HashtagMenuController: React.FC = () => {
const intl = useIntl(); const intl = useIntl();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [{ accountId, hashtag, hashtagUrl }, setTargetParams] = useState<TargetParams>({}); const [{ accountId, hashtag, hashtagUrl }, setTargetParams] =
useState<TargetParams>({});
const targetRef = useRef<HTMLAnchorElement | null>(null); const targetRef = useRef<HTMLAnchorElement | null>(null);
const location = useLocation(); const location = useLocation();
const account = useAppSelector((state) => const account = useAppSelector((state) =>
@ -78,9 +79,15 @@ export const HashtagMenuController: React.FC = () => {
return; return;
} }
const hashtagUrl: URL = new URL('/filters', document.location.href) const hashtagUrl: URL = new URL('/filters', document.location.href);
hashtagUrl.searchParams.set('custom_filter[keywords_attributes][0][keyword]', target.text) hashtagUrl.searchParams.set(
hashtagUrl.searchParams.set('custom_filter[keywords_attributes][0][whole_word]', '1') 'custom_filter[keywords_attributes][0][keyword]',
target.text,
);
hashtagUrl.searchParams.set(
'custom_filter[keywords_attributes][0][whole_word]',
'1',
);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();