From 4ba516f8f371ba36f94fed5520b7cfd3d3639a3a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 22 Jun 2017 14:32:38 +0200 Subject: [PATCH] Fixed add-anime-lists patch --- patches/add-anime-lists/main.go | 4 +++- scripts/actions.ts | 4 ++-- styles/forms.scarlet | 2 +- styles/navigation.scarlet | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/patches/add-anime-lists/main.go b/patches/add-anime-lists/main.go index 09e8e7f9..51eb9275 100644 --- a/patches/add-anime-lists/main.go +++ b/patches/add-anime-lists/main.go @@ -19,7 +19,9 @@ func main() { // Iterate over the stream for user := range allUsers { - if user.AnimeList() == nil { + exists, err := arn.DB.Exists("AnimeList", user.ID) + + if err == nil && !exists { fmt.Println(user.Nick) err := arn.DB.Set("AnimeList", user.ID, &arn.AnimeList{ diff --git a/scripts/actions.ts b/scripts/actions.ts index c5ea25c8..c6a8f702 100644 --- a/scripts/actions.ts +++ b/scripts/actions.ts @@ -65,8 +65,8 @@ export function search(arn: AnimeNotifier, search: HTMLInputElement, e: Keyboard history.replaceState("search", null, "/search/" + term) } - if(!term) { - arn.app.content.innerHTML = "No search term." + if(!term || term.length < 2) { + arn.app.content.innerHTML = "Please enter at least 2 characters to start searching." return } diff --git a/styles/forms.scarlet b/styles/forms.scarlet index 506f1797..a151dde3 100644 --- a/styles/forms.scarlet +++ b/styles/forms.scarlet @@ -12,7 +12,7 @@ input, textarea :focus color black - border 1px solid main-color !important + border 1px solid main-color // TODO: Replace with alpha(main-color, 20%) function box-shadow 0 0 6px rgba(248, 165, 130, 0.2) diff --git a/styles/navigation.scarlet b/styles/navigation.scarlet index cbbc44ae..89582ed3 100644 --- a/styles/navigation.scarlet +++ b/styles/navigation.scarlet @@ -47,12 +47,13 @@ border-radius 0 background text-color border none + color white font-size 1em min-width 0 :focus - border none !important + border none box-shadow none .extra-navigation