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:
@ -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>) => {
|
||||
|
||||
Reference in New Issue
Block a user