Sfoglia il codice sorgente

fix: need to respect clear-search-mode? option

Weihua Lu 4 anni fa
parent
commit
4685c8f3cc
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/main/frontend/handler/search.cljs

+ 1 - 1
src/main/frontend/handler/search.cljs

@@ -37,7 +37,7 @@
    (let [m {:search/result nil
    (let [m {:search/result nil
             :search/q ""}]
             :search/q ""}]
      (swap! state/state merge m))
      (swap! state/state merge m))
-   (when-not (= (state/get-search-mode) :graph)
+   (when (and clear-search-mode? (not= (state/get-search-mode) :graph))
      (state/set-search-mode! :global))
      (state/set-search-mode! :global))
    (when-let [input (gdom/getElement "search-field")]
    (when-let [input (gdom/getElement "search-field")]
      (gobj/set input "value" ""))))
      (gobj/set input "value" ""))))