From aeec8f79b2c4ada35fd4672fccb2b7e4edfcb012 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 4 Sep 2024 12:26:26 -0400 Subject: [PATCH] fixed search dialog opening anime --- frontend/src/App.svelte | 3 +-- frontend/src/helperComponents/Search.svelte | 25 +++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index d62bcc8..b244ed9 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -34,7 +34,6 @@ import Home from "./routes/Home.svelte"; import {wrap} from "svelte-spa-router/wrap"; import Spinner from "./helperComponents/Spinner.svelte"; - import Anime from "./routes/Anime.svelte"; import Header from "./helperComponents/Header.svelte"; @@ -111,7 +110,7 @@ import('./routes/Anime.svelte'), conditions: [ async (detail) => { await GetAniListSingleItem(Number(detail.params.id), true) diff --git a/frontend/src/helperComponents/Search.svelte b/frontend/src/helperComponents/Search.svelte index f16d0cd..890a39f 100644 --- a/frontend/src/helperComponents/Search.svelte +++ b/frontend/src/helperComponents/Search.svelte @@ -2,7 +2,7 @@ import {AniListSearch} from "../../wailsjs/go/main/App"; import type {AniSearchList} from "../anilist/types/AniListTypes"; - import {GetAniListSingleItem, loading} from "./GlobalVariablesAndHelperFunctions.svelte"; + import {push} from "svelte-spa-router"; let aniSearch = "" let aniListSearch: AniSearchList @@ -30,7 +30,14 @@
+ placeholder="Search for Anime" + on:keypress={(e) => { + if (e.key === "Enter") { + searchDropdown() + if(aniSearch.length > 0) runAniListSearch() + } + }} + required/>