Fix bug when no search param specified

This commit is contained in:
John R. Supplee 2021-01-17 21:18:45 +02:00
parent 7e8475e64d
commit e70a1f0a60

View file

@ -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',