Skip to content

Commit 3dfccce

Browse files
committed
Fix ampersand handling in book title for interest and adoption forms
1 parent 6739fd6 commit 3dfccce

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/app/pages/adoption/adoption.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ function ContactInfoPage({selectedRole, validatorRef}) {
2525
}
2626

2727
function firstSearchArgument() {
28-
return decodeURIComponent(window.location.search.substr(1))
29-
.replace(/&.*/, '');
28+
return decodeURIComponent(window.location.search.substr(1).replace(/&.*/, ''));
3029
}
3130

3231
function BookSelectorPage({selectedBooksRef}) {

src/app/pages/interest/interest.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ function ContactInfoPage({selectedRole, validatorRef}) {
2626
}
2727

2828
function firstSearchArgument() {
29-
return decodeURIComponent(window.location.search.substr(1))
30-
.replace(/&.*/, '');
29+
return decodeURIComponent(window.location.search.substr(1).replace(/&.*/, ''));
3130
}
3231

3332
function HowDidYouHear() {
@@ -110,6 +109,10 @@ function FacultyForm({selectedRole, onPageChange}) {
110109
const submitQueue = selectedBooks.slice();
111110
const iframe = document.getElementById(form.target);
112111

112+
if (submitQueue.length === 0) {
113+
return;
114+
}
115+
113116
// eslint-disable-next-line no-use-before-define
114117
const submitAfterDelay = () => setTimeout(submitNextBook, 300);
115118

0 commit comments

Comments
 (0)