From 045a2ef4436ef20be1baa9caa69934460f19e881 Mon Sep 17 00:00:00 2001
From: Dmitri Bogomolov <4glitch@gmail.com>
Date: Fri, 17 May 2019 12:36:35 +0300
Subject: [PATCH] Update messagelist also if search line cleared

---
 src/bitmessageqt/__init__.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py
index bf391882..559ad0dd 100644
--- a/src/bitmessageqt/__init__.py
+++ b/src/bitmessageqt/__init__.py
@@ -3884,14 +3884,16 @@ class MyForm(settingsmixin.SMainWindow):
 
     def inboxSearchLineEditUpdated(self, text):
         # dynamic search for too short text is slow
-        if len(str(text)) < 3:
+        text = str(text)
+        if 0 < len(text) < 3:
             return
         messagelist = self.getCurrentMessagelist()
         searchOption = self.getCurrentSearchOption()
         if messagelist:
             account = self.getCurrentAccount()
             folder = self.getCurrentFolder()
-            self.loadMessagelist(messagelist, account, folder, searchOption, str(text))
+            self.loadMessagelist(
+                messagelist, account, folder, searchOption, text)
 
     def inboxSearchLineEditReturnPressed(self):
         logger.debug("Search return pressed")