mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 10:23:24 +00:00
chore: catch search
This commit is contained in:
@@ -14,7 +14,7 @@ export default function SearchScreen() {
|
|||||||
|
|
||||||
const handleSearchChange = async (query: string) => {
|
const handleSearchChange = async (query: string) => {
|
||||||
if (query.length > 0) {
|
if (query.length > 0) {
|
||||||
const results = await fetchSearchResults(query);
|
const results = await fetchSearchResults(query).catch(() => []);
|
||||||
setSearchResults(results);
|
setSearchResults(results);
|
||||||
} else {
|
} else {
|
||||||
setSearchResults([]);
|
setSearchResults([]);
|
||||||
@@ -45,7 +45,7 @@ export default function SearchScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchSearchResults(query: string): Promise<ItemData[]> {
|
async function fetchSearchResults(query: string): Promise<ItemData[]> {
|
||||||
const results = await searchTitle(query);
|
const results = await searchTitle(query)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
.map((result) => {
|
.map((result) => {
|
||||||
|
Reference in New Issue
Block a user