Explorar el Código

Fix bug when no search param specified

John R. Supplee hace 4 años
padre
commit
e70a1f0a60
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      config/router.js

+ 6 - 4
config/router.js

@@ -160,10 +160,12 @@ FlowRouter.route('/global-search', {
     Utils.manageMatomo();
     DocHead.setTitle(TAPi18n.__('globalSearch-title'));
 
-    Session.set(
-      'globalQuery',
-      decodeURIComponent(FlowRouter.getQueryParam('q')),
-    );
+    if (FlowRouter.getQueryParam('q')) {
+      Session.set(
+        'globalQuery',
+        decodeURIComponent(FlowRouter.getQueryParam('q')),
+      );
+    }
     BlazeLayout.render('defaultLayout', {
       headerBar: 'globalSearchHeaderBar',
       content: 'globalSearch',