Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7f9b586

Browse files
Merge pull request #126 from GSA/FootnoteRef
Fixes Footnote Problem
2 parents 50beffb + 47bf684 commit 7f9b586

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/components/lazy-html/lazy-html.component.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export default class LazyHTML extends Component {
2323
}
2424
}
2525

26+
componentDidUpdate() {
27+
if (this.props.onUpdate) {
28+
this.props.onUpdate()
29+
}
30+
}
31+
2632
componentWillUnmount() {
2733
this.mounted = false
2834
}

src/utils/url-parsing.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
export function getURLSearchParamsAsSimpleObj(search) {
22
search = search || window.location.search
3-
if (typeof search === 'string') {
3+
if (search && typeof search === 'string') {
44
return search.substring(1).split('&').reduce((result, part) => {
55
try {
6-
const [ key, value] = part.split("=");
7-
result[key] = decodeURIComponent(value);
6+
if (part && part.includes('=')) {
7+
const [ key, value] = part.split('=');
8+
result[key] = decodeURIComponent(value);
9+
}
810
} catch (error) {
911
console.error(error);
1012
}
1113
return result
1214
}, {});
15+
} else {
16+
return {}
1317
}
1418
}
1519

0 commit comments

Comments
 (0)