Skip to content

Commit

Permalink
Merge 78d3137 into 2527fbf
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Feb 25, 2022
2 parents 2527fbf + 78d3137 commit fa7bef0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/js/apps/discovery/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,22 @@ define([
this.routerNavigate('PaperSearchForm');
},

feedbackPage: function(subview, query) {
// if necessary encode ampersands present in the bibcode
query = query.replace('&', encodeURIComponent('&'));
const params = new URLSearchParams(query);
feedbackPage: function(subview, query = '') {
let bibcode = '';

try {
// if necessary encode ampersands present in the bibcode
query = query.replace('&', encodeURIComponent('&'));
const params = new URLSearchParams(query);
bibcode = params.get('bibcode');
} catch (e) {
bibcode = '';
}

this.routerNavigate(`ShowFeedback`, {
subview,
href: `#feedback/${subview}`,
bibcode: params.get('bibcode'),
bibcode,
});
},

Expand Down

0 comments on commit fa7bef0

Please sign in to comment.