diff --git a/frontend/app/components/LogInNeeded/LogInNeeded.jsx b/frontend/app/components/LogInNeeded/LogInNeeded.jsx index ea82598..7ca2e32 100644 --- a/frontend/app/components/LogInNeeded/LogInNeeded.jsx +++ b/frontend/app/components/LogInNeeded/LogInNeeded.jsx @@ -1,7 +1,5 @@ "use client"; -import Link from "next/link"; - export const LogInNeeded = (props) => { return (
diff --git a/frontend/app/search/page.js b/frontend/app/search/page.js index 2881ac0..9a1cebc 100644 --- a/frontend/app/search/page.js +++ b/frontend/app/search/page.js @@ -69,20 +69,22 @@ export default function Search() { const handleSubmit = async (e) => { e.preventDefault(); - router.push(pathname + "?" + createQueryString("query", query)); - setReleases(null); - setPage(0); - fetchData(query); + if (query != "") { + router.push(pathname + "?" + createQueryString("query", query)); + setReleases(null); + setPage(0); + fetchData(query); - // save searches and update search history - if (!searches) { - setSearches([query]); - saveSearches(JSON.stringify([query])); - } else { - console.log(searches); - if (!searches.find((element) => element == query)) { - setSearches([query, ...searches.slice(0, 5)]); - saveSearches(JSON.stringify([query, ...searches.slice(0, 5)])); + // save searches and update search history + if (!searches) { + setSearches([query]); + saveSearches(JSON.stringify([query])); + } else { + console.log(searches); + if (!searches.find((element) => element == query)) { + setSearches([query, ...searches.slice(0, 5)]); + saveSearches(JSON.stringify([query, ...searches.slice(0, 5)])); + } } } }; @@ -115,26 +117,37 @@ export default function Search() {
{releases ? ( - <> -
- -
+ releases.lenght > 0 ? ( + <> +
+ +
- - + + + ) : ( +
+ search +
Ничего не найдено.
+

Введите другой поисковой запрос.

+
+ ) ) : ( - // - "" +
+ search +
Здесь пока ничего нет.
+

Введите поисковой запрос для начала поиска.

+
)} );