Преглед изворни кода

Fix search initialization when only tags/type present, fixes #915

Jordi Boggiano пре 6 година
родитељ
комит
d7769bdfc8
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      src/Packagist/WebBundle/Resources/public/js/search.js

+ 7 - 2
src/Packagist/WebBundle/Resources/public/js/search.js

@@ -29,12 +29,17 @@ var search = instantsearch({
                 if (routeState.q) {
                     routeState.query = routeState.q;
                 }
-                if (routeState.query === undefined || routeState.query === '') {
+
+                if (
+                    (routeState.query === undefined || routeState.query === '')
+                    && (routeState.type === undefined || routeState.type === '')
+                    && (routeState.tags === undefined || routeState.tags === '')
+                ) {
                     return {};
                 }
 
                 return {
-                    query: routeState.query,
+                    query: routeState.query || '',
                     menu: {
                         type: routeState.type
                     },