Skip to content

Commit 3cbfcf1

Browse files
committed
fix order of buildings
1 parent fa550ff commit 3cbfcf1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/components/Calendar.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ export function Calendar() {
6161
* is more than half a mile, return an appropriate warning message. Otherwise,
6262
* return undefined.
6363
*/
64-
const getDistanceWarning = (currentEvent: EventApi) => {
65-
const room1 = currentEvent.extendedProps.room as string | undefined;
66-
if (!currentEvent.start || !room1) {
64+
const getDistanceWarning = (thisEvent: EventApi) => {
65+
const thisRoom = thisEvent.extendedProps.room as string | undefined;
66+
if (!thisEvent.start || !thisRoom) {
6767
return undefined;
6868
}
6969

70-
for (const eventBefore of events) {
71-
if (!eventBefore.start || !eventBefore.room) {
70+
for (const beforeEvent of events) {
71+
if (!beforeEvent.start || !beforeEvent.room) {
7272
continue;
7373
}
74-
if (currentEvent.start.getTime() != eventBefore.end.getTime()) {
74+
if (thisEvent.start.getTime() != beforeEvent.end.getTime()) {
7575
continue;
7676
}
7777

78-
const building1 = getBuildingNumber(room1);
79-
const building2 = getBuildingNumber(eventBefore.room);
78+
const thisBuilding = getBuildingNumber(thisRoom);
79+
const beforeBuilding = getBuildingNumber(beforeEvent.room);
8080

8181
// Approximate distance (in feet) between the two buildings
82-
const distance = getDistance(building1, building2);
82+
const distance = getDistance(thisBuilding, beforeBuilding);
8383

8484
if (distance === undefined || distance < DISTANCE_WARNING_THRESHOLD) {
8585
continue;
@@ -90,7 +90,7 @@ export function Calendar() {
9090

9191
return (
9292
<Text>
93-
Warning: distance from {building1} to {building2} is{" "}
93+
Warning: distance from {beforeBuilding} to {thisBuilding} is{" "}
9494
{formattedDistance}
9595
<br />
9696
(about a {mins}-minute walk)

0 commit comments

Comments
 (0)