Skip to content

Commit

Permalink
Fix map estimate when no date input found
Browse files Browse the repository at this point in the history
  • Loading branch information
samwilson authored Nov 12, 2022
1 parent 4b9e015 commit 24f86d4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions assets/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ map.on('click', clickEvent => {

const dateInput = document.querySelector('input[name="date"]');
let estimatedMarker = null;
dateInput.addEventListener('change', (event) => {
setEstimatedLocation(event.target.value);
});
setEstimatedLocation(dateInput.value);
if (dateInput) {
dateInput.addEventListener('change', (event) => {
setEstimatedLocation(event.target.value);
});
setEstimatedLocation(dateInput.value);
} else {
setEstimatedLocation('');
}

function setEstimatedLocation (date) {
// eslint-disable-next-line no-undef
Expand Down
2 changes: 1 addition & 1 deletion public/build/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"/build/runtime.188fa053.js",
"/build/98.7dea510e.js",
"/build/805.3e825de1.js",
"/build/map.7b6a8e18.js"
"/build/map.4da0d45a.js"
],
"css": [
"/build/map.fa728e1a.css"
Expand Down
2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"build/app.css": "/build/app.ab8285ed.css",
"build/app.js": "/build/app.6dc3586a.js",
"build/map.css": "/build/map.fa728e1a.css",
"build/map.js": "/build/map.7b6a8e18.js",
"build/map.js": "/build/map.4da0d45a.js",
"build/frontend.css": "/build/frontend.709f92e8.css",
"build/frontend.js": "/build/frontend.a6e25d71.js",
"build/runtime.js": "/build/runtime.188fa053.js",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24f86d4

Please sign in to comment.