From 1dcc036dc7e2df503e0196fd468c6efdbf54005d Mon Sep 17 00:00:00 2001 From: Thomas Kam Date: Tue, 3 Oct 2023 02:30:41 -0400 Subject: [PATCH] line 3 --- src/components/fetch/FetchRouteList.tsx | 2 +- src/components/fetch/FetchSubwayRoute.tsx | 56 +++++++++++++++++++---- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/components/fetch/FetchRouteList.tsx b/src/components/fetch/FetchRouteList.tsx index 4ddd6e1..3efeb11 100644 --- a/src/components/fetch/FetchRouteList.tsx +++ b/src/components/fetch/FetchRouteList.tsx @@ -115,7 +115,7 @@ function subwayCards() { function JumpBar() { const jumpbarMap = [ - ['', "Regular"], + ["", "Regular"], [200, "Seasonal"], [300, "Night"], [501, "Streetcar"], diff --git a/src/components/fetch/FetchSubwayRoute.tsx b/src/components/fetch/FetchSubwayRoute.tsx index 59d8eec..cce843b 100644 --- a/src/components/fetch/FetchSubwayRoute.tsx +++ b/src/components/fetch/FetchSubwayRoute.tsx @@ -23,13 +23,15 @@ function RouteInfo(props: { line: number }): JSX.Element { return data; }; - fetchSubwayData().then((res) => { - try { - setData(JSON.parse(res)); - } catch (error) { - setData({ routeBranchesWithStops: [], Error: true }); - } - }); + if (lineNum !== 3) { + fetchSubwayData().then((res) => { + try { + setData(JSON.parse(res)); + } catch (error) { + setData({ routeBranchesWithStops: [], Error: true }); + } + }); + } // when useEffect is called, the following clean-up fn will run first return () => { @@ -78,7 +80,12 @@ function RouteInfo(props: { line: number }): JSX.Element { return (