Эх сурвалжийг харах

HUE-7545 [search] Reset query string in URL when it becomes empty

Romain Rigaux 8 жил өмнө
parent
commit
2db2368

+ 2 - 2
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -2010,8 +2010,8 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       }
       else if (location.getParameter("collection") != "") {
         var firstQuery = self.query.qs()[0].q();
-        if (firstQuery) {
-          hueUtils.changeURL("?collection=" + location.getParameter("collection") + "&q=" + firstQuery);
+        if (firstQuery != location.getParameter("q")) {
+          hueUtils.changeURL("?collection=" + location.getParameter("collection") + (firstQuery ? "&q=" + firstQuery : ""));
         }
       }