From 1e8e475bd2b2637b7eef97d4de44112f01187f39 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Tue, 21 Mar 2017 17:43:52 +0100
Subject: [PATCH] Do not search for empty values

---
 res/js/app.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/res/js/app.js b/res/js/app.js
index f8a548a..19a5070 100644
--- a/res/js/app.js
+++ b/res/js/app.js
@@ -29,6 +29,13 @@ class App {
 
     search(query) {
         this.clear();
+        this.navigation.historyView.add(new HistoryElement(query));
+        this.navigation.input.value = query;
+        this.urlBar.set(query);
+
+        if (query.trim() === "")
+            return;
+
         this.loadingQuery++;
         const queryId = this.loadingQuery;
         load("web/search/", {query: query}).then((result) => {
@@ -42,9 +49,6 @@ class App {
             });
             this.buffers.forEach((buffer) => this.insert(buffer));
         });
-        this.navigation.historyView.add(new HistoryElement(query));
-        this.navigation.input.value = query;
-        this.urlBar.set(query);
     }
 
     clear() {
-- 
GitLab