From: Adam Dullage Date: Fri, 12 Aug 2022 07:22:58 +0000 (+0100) Subject: LoadingIndicator Improvements X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=19e336dc4ec35ed681bf9089b4bdccbf53bf258b;p=flatnotes.git LoadingIndicator Improvements --- diff --git a/flatnotes/src/colours.scss b/flatnotes/src/colours.scss index bf70512..1cc3862 100644 --- a/flatnotes/src/colours.scss +++ b/flatnotes/src/colours.scss @@ -5,3 +5,4 @@ $muted-text: #6c757d; $text: #222222; $button-background: #00000010; $input-highlight: #bbcdff; +$logo-key-colour: #f9a76b; diff --git a/flatnotes/src/components/App.js b/flatnotes/src/components/App.js index 27d9d42..8aabe52 100644 --- a/flatnotes/src/components/App.js +++ b/flatnotes/src/components/App.js @@ -105,16 +105,22 @@ export default { .get("/api/search", { params: { term: this.searchTerm } }) .then(function(response) { parent.searchResults = []; - response.data.forEach(function(result) { - parent.searchResults.push( - new SearchResult( - result.title, - result.lastModified, - result.titleHighlights, - result.contentHighlights - ) - ); - }); + if (response.data.length == 0) { + parent.searchFailedIcon = "search"; + parent.searchFailedMessage = "No Results"; + parent.searchFailed = true; + } else { + response.data.forEach(function(result) { + parent.searchResults.push( + new SearchResult( + result.title, + result.lastModified, + result.titleHighlights, + result.contentHighlights + ) + ); + }); + } }) .catch(function(error) { if (!error.handled) { diff --git a/flatnotes/src/components/App.vue b/flatnotes/src/components/App.vue index 47d9a0a..ed23a86 100644 --- a/flatnotes/src/components/App.vue +++ b/flatnotes/src/components/App.vue @@ -1,5 +1,5 @@