From 545aa3d0630e86f519467334cd94c17843ed5f68 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Mon, 21 Oct 2024 16:18:52 +0200 Subject: [PATCH] fix(Assistant): SearchProvider wasn't emptied when emptying search input --- src/assistant/Search/SearchBar.jsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/assistant/Search/SearchBar.jsx b/src/assistant/Search/SearchBar.jsx index 7d732d6522..1c49e1930d 100644 --- a/src/assistant/Search/SearchBar.jsx +++ b/src/assistant/Search/SearchBar.jsx @@ -11,7 +11,7 @@ import SearchBarDesktop from './SearchBarDesktop' const SearchBar = () => { const { isMobile } = useBreakpoints() const [inputValue, setInputValue] = useState('') - const { setSearchValue, clearSearch, delayedSetSearchValue } = useSearch() + const { clearSearch, delayedSetSearchValue } = useSearch() const { onAssistantExecute } = useAssistant() const navigate = useNavigate() @@ -38,11 +38,7 @@ const SearchBar = () => { } const handleChange = ev => { - if (ev.target.value === '') { - setSearchValue(ev.target.value) - } else { - delayedSetSearchValue(ev.target.value) - } + delayedSetSearchValue(ev.target.value) setInputValue(ev.target.value) }