Skip to content

Commit

Permalink
Merge pull request #5085 from nasa-gibs/update-eic-endpoint
Browse files Browse the repository at this point in the history
Update EIC Endpoint
  • Loading branch information
ryanweiler92 authored Apr 3, 2024
2 parents 930edbe + 70eda35 commit 473fa82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions web/js/components/timeline/kiosk-timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function KioskTimeStamp({ date, subdaily, isKioskModeActive }) {
timeZone: 'America/New_York',
};

const updateKioskModeTime = isKioskModeActive && subdaily;

const isDaylightSavingsTime = getIsDaylightSavingsTime();
const formatter = new Intl.DateTimeFormat('en-US', options);
const dateParts = formatter.formatToParts(date);
Expand All @@ -40,10 +42,10 @@ function KioskTimeStamp({ date, subdaily, isKioskModeActive }) {
const dfDay = util.pad(date.getUTCDate(), 2, '0');
const dfHour = util.pad(date.getUTCHours(), 2, '0');

const year = isKioskModeActive ? kioskYear : dfYear;
const month = isKioskModeActive ? kioskMonth : dfMonth;
const day = isKioskModeActive ? kioskDay : dfDay;
const hour = isKioskModeActive ? kioskHour : dfHour;
const year = updateKioskModeTime ? kioskYear : dfYear;
const month = updateKioskModeTime ? kioskMonth : dfMonth;
const day = updateKioskModeTime ? kioskDay : dfDay;
const hour = updateKioskModeTime ? kioskHour : dfHour;

const minutes = dateParts.find((part) => part.type === 'minute').value;
const timeZoneLabel = isDaylightSavingsTime ? 'EDT' : 'EST';
Expand Down
2 changes: 1 addition & 1 deletion web/js/mapUI/components/eic/eic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function EIC() {

const requestBestDate = async () => {
try {
const url = `https://m80gyw03f7.execute-api.us-east-1.amazonaws.com/dev/scenarios?item_type=scenario&item_id=${scenario}`;
const url = `https://uhkookzof2.execute-api.us-west-2.amazonaws.com/dev/scenarios?item_type=scenario&item_id=${scenario}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Network response was not ok.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ function TileMeasurement({ ui }) {
// If we are using the best date, we need to make sure there are tiles on the map so we include the abort prodcedure parameter
// This allows us to fall back to the static map if the best date fails as a last resort
const bestDate = findBestDate(measurementLayers, bestDates);
if (!fullImageryDate || bestDate === fullImageryDate) return verifyTilesAndHandleErrors();
if (!fullImageryDate || bestDate === fullImageryDate) {
updateDate(bestDate, layerPeriod);
verifyTilesAndHandleErrors();
return;
}

// Format date based on period and dispatch redux action
updateDate(fullImageryDate, layerPeriod);
Expand All @@ -236,7 +240,7 @@ function TileMeasurement({ ui }) {
setMeasurementsStarted(true);
calculateMeasurements();
}
}, [ui.selected]);
}, [ui.selected, eicLegacy]);

return null;
}
Expand Down

0 comments on commit 473fa82

Please sign in to comment.