Skip to content

Commit

Permalink
Cleaned up conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 committed Nov 16, 2023
1 parent 466a189 commit 7359387
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions assets/js/components/Dashboard/ScreenDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ const ScreenCard = (props: ScreenDetailProps) => {
}
};

const getTriptychPlatform = (directionId: number) =>
directionId === 0 ? "Southbound" : "Northbound";

const getScreenLocation = () => {
if (isPaess) {
return `/ ${getPaessRoute(paessRouteLetter)}`;
} else if (isTriptych) {
const [_prefix, _stationsName, _routeId, directionId, _index] =
screens[0].id.split("-");

if (parseInt(directionId) === 0) {
return "/ Southbound";
} else {
return "/ Northbound";
}
return `/ ${getTriptychPlatform(parseInt(directionId))}`;
} else if (screens[0].location) {
return `/ ${screens[0].location}`;
} else {
Expand Down

0 comments on commit 7359387

Please sign in to comment.