瀏覽代碼

fix: stop search loading when exiting

NGPixel 5 年之前
父節點
當前提交
144950ea70
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      client/components/common/search-results.vue

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

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