Skip to content

Commit b6dbb68

Browse files
committed
Update SiteFooter.tsx
1 parent b434bba commit b6dbb68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

frontend/src/components/SiteFooter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from "react";
1+
import { useCallback, useEffect, useState } from "react";
22
import { useHealth } from "src/hooks";
33
import { T } from "src/locale";
44

@@ -24,13 +24,13 @@ export function SiteFooter() {
2424
const [latestVersion, setLatestVersion] = useState<string | null>(null);
2525
const [isNewVersionAvailable, setIsNewVersionAvailable] = useState(false);
2626

27-
const getVersion = () => {
27+
const getVersion = useCallback(() => {
2828
if (!health.data) {
2929
return "";
3030
}
3131
const v = health.data.version;
3232
return `v${v.major}.${v.minor}.${v.revision}`;
33-
};
33+
}, [health.data]);
3434

3535
useEffect(() => {
3636
const checkForUpdates = async () => {
@@ -56,7 +56,7 @@ export function SiteFooter() {
5656
if (health.data) {
5757
checkForUpdates();
5858
}
59-
}, [health.data]);
59+
}, [health.data, getVersion]);
6060

6161
return (
6262
<footer className="footer d-print-none py-3">

0 commit comments

Comments
 (0)