mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
only supply full name if it's different
This commit is contained in:
1 parent
6153beced6
commit
f3a8f2faab
2 files changed
+21
-11
No files matched your search
@@ -33,7 +33,7 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
||||
draft.search = sanitized.length === 0 ? null : sanitized;
|
||||
});
|
||||
}, 500),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
const handleChange = useCallback(() => {
|
||||
if (!searching) {
|
||||
@@ -46,8 +46,14 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
||||
}, [searching]);
|
||||
const handleKeyDown = useCallback<KeyboardEventHandler>(
|
||||
(event) => {
|
||||
if (event.key !== "Enter" || !topResult) return;
|
||||
if (!TankFilters.state.search || TankFilters.state.searching) return;
|
||||
if (
|
||||
event.key !== "Enter" ||
|
||||
!topResult ||
|
||||
!TankFilters.state.search ||
|
||||
TankFilters.state.searching
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@@ -57,7 +63,7 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
||||
window.location.href = `/tanks/${topResult.slug}`;
|
||||
}
|
||||
},
|
||||
[topResult]
|
||||
[topResult],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user