Browse Source

fix: stop search loading when exiting

NGPixel 5 năm trước cách đây
mục cha
commit
144950ea70

+ 2 - 1
client/components/common/search-results.vue

@@ -100,9 +100,10 @@ export default {
   watch: {
   watch: {
     search(newValue, oldValue) {
     search(newValue, oldValue) {
       this.cursor = 0
       this.cursor = 0
-      if (newValue && newValue.length < 2) {
+      if (!newValue || (newValue && newValue.length < 2)) {
         this.response.results = []
         this.response.results = []
         this.response.suggestions = []
         this.response.suggestions = []
+        this.searchIsLoading = false
       } else {
       } else {
         this.searchIsLoading = true
         this.searchIsLoading = true
       }
       }