From 0095ea12710df7a3332d8443ec8626bb12246ab1 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Tue, 18 Feb 2020 18:00:39 -0500 Subject: [PATCH] fixed bug where search results showed old results when search bar was empty --- src/app/main/main.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index 7cb3ec72..7effbd63 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -402,7 +402,7 @@ export class MainComponent implements OnInit { } inputChanged(new_val) { - if (new_val === '') { + if (new_val === '' || !new_val) { this.results_showing = false; } else { if (this.ValidURL(new_val)) { @@ -465,7 +465,7 @@ export class MainComponent implements OnInit { .subscribe( (results: Result[]) => { this.results_loading = false; - if (results && results.length > 0) { + if (this.url !== '' && results && results.length > 0) { this.results = results; this.results_showing = true; } else {