Skip to content

Commit

Permalink
Dependencies update
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed Aug 19, 2024
1 parent d3ca256 commit 34904d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"core-js": "^3.23.1",
"dayjs": "^1.11.7",
"dom-to-image": "^2.6.0",
"hk-bus-eta": "^3.3.5",
"hk-bus-eta": "^3.4.0",
"i18next": "^23.10.0",
"immer": "^9.0.15",
"leaflet": "^1.9.4",
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/NoticeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const NoticeCard = () => {
const [state, setState] = useState<NoticeCardState | null>(null);

useEffect(() => {
console.log("hihi");
fetch("/notice.json")
.then((r) => r.json())
.then((r) => setState(r));
Expand Down
19 changes: 3 additions & 16 deletions src/components/route-eta/RouteUpdateNotice.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, SxProps, Theme, Typography } from "@mui/material";
import { useContext, useEffect, useState } from "react";
import DbContext from "../../context/DbContext";
import { RouteListEntry } from "hk-bus-eta";
import { fetchRouteUpdatedAt, RouteListEntry } from "hk-bus-eta";
import { useTranslation } from "react-i18next";

interface RouteUpdateNoticeProps {
Expand All @@ -17,21 +17,8 @@ const RouteUpdateNotice = ({ route }: RouteUpdateNoticeProps) => {
const { t } = useTranslation();

useEffect(() => {
fetch(
`https://data.hkbus.app/route-ts/${`${route.route}+${route.serviceType}+${route.orig.en}+${route.dest.en}`.toUpperCase()}`
)
.then((r) => {
if (r.ok) {
return r.text();
}
throw Error("no update");
})
.then((r) => {
setShow(parseInt(r, 10) * 1000 > updateTime);
})
.catch((e) => {
console.log(e.message);
});
fetchRouteUpdatedAt(route)
.then(updatedAt => setShow(updatedAt > updateTime))
}, [route, updateTime]);

if (!show) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5497,10 +5497,10 @@ hast-util-whitespace@^2.0.0:
resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz#0ec64e257e6fc216c7d14c8a1b74d27d650b4557"
integrity sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==

hk-bus-eta@^3.3.5:
version "3.3.5"
resolved "https://registry.yarnpkg.com/hk-bus-eta/-/hk-bus-eta-3.3.5.tgz#6a75c414a539adecb555402ff084022828c2f8ed"
integrity sha512-YANg22gqVjxwDMXdzBMr7R90pEvbmEOkuYoVwQK6JawMp0NOPyyFNZ8U11hgmtqNXB8ZMu5gxdByhAkx4iDQHg==
hk-bus-eta@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/hk-bus-eta/-/hk-bus-eta-3.4.0.tgz#98c7e5b7cf6ffb133e18f3fb1bd2d8eebba036a4"
integrity sha512-GFNbdNxGTQx2erySfT3yzUfAAChYz6Y0JuXex2yyq/Xo71Dfx6//J4KpoFqEvn2Awv1atMPyEWbKv3/CaZLf+A==

hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2:
version "3.3.2"
Expand Down

0 comments on commit 34904d2

Please sign in to comment.