From 524b7dec4c73848e35aaaad6e66ccbf4941d5f54 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 1 Nov 2021 23:46:31 +0000 Subject: [PATCH] Show message if no emoji are found --- webapp_search.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp_search.py b/webapp_search.py index b823e03d1..50d8dc8b8 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -82,6 +82,7 @@ def htmlSearchEmoji(cssCache: {}, translate: {}, customEmojiJson = loadJson(customEmojiLookupFilename) if customEmojiJson: emojiJson = dict(emojiJson, **customEmojiJson) + results = {} for emojiName, filename in emojiJson.items(): if searchStr in emojiName: @@ -89,6 +90,11 @@ def htmlSearchEmoji(cssCache: {}, translate: {}, for emojiName, filename in emojiJson.items(): if emojiName in searchStr: results[emojiName] = filename + '.png' + + if not results: + emojiForm += '
' + \ + translate['No results'] + '
' + headingShown = False emojiForm += '
' msgStr1 = translate['Copy the text then paste it into your post']