nicolium: make search input navigate to statuses tab if something looks like a status url

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-02-18 14:24:27 +01:00
parent 103c88f1ce
commit bfc4286e03

View File

@ -33,7 +33,10 @@ const SearchInput = React.memo(() => {
const handleSubmit = () => {
setValue('');
navigate({ to: '/search', search: { q: value } });
const guessedType = /^(?:\/statuses\/|\/notice\/|\/objects\/|\/@[\w.-]+\/\d+)/.test(value)
? 'statuses'
: 'accounts';
navigate({ to: '/search', search: { q: value, type: guessedType } });
};
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {