[web] Fix dev mode error on search input (#1453)

## Description
Ran into error after clearing search bar of queries by hitting
backspace.

>  The error is shown below
> Thank you to the team for considering 


## Tests
**Error**
![Screenshot 2024-04-15
184234](https://github.com/ente-io/ente/assets/82031202/f5f9845c-9420-4746-998b-2c67136d69cd)
**Fix**
Fixed by wrapping the line-causing error around by an `if` block.
This commit is contained in:
Manav Rathi 2024-04-15 20:50:06 +05:30 committed by GitHub
commit 020ed59d40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,8 +56,11 @@ export default function SearchInput(props: Iprops) {
const [value, setValue] = useState<SearchOption>(null); const [value, setValue] = useState<SearchOption>(null);
const appContext = useContext(AppContext); const appContext = useContext(AppContext);
const handleChange = (value: SearchOption) => { const handleChange = (value: SearchOption) => {
setValue(value); if (value) {
setQuery(value.label); setValue(value);
setQuery(value.label);
}
blur(); blur();
}; };
const handleInputChange = (value: string, actionMeta: InputActionMeta) => { const handleInputChange = (value: string, actionMeta: InputActionMeta) => {