Fixed the latest test bug

This commit is contained in:
Mathias Wagner
2022-05-08 02:55:27 +02:00
parent ef5dc40026
commit 60296d3c75
+6 -3
View File
@@ -22,9 +22,12 @@ function LatestTestComponent() {
});
}, [setLatest]);
setTimeout(() => {
setLatestTestTime(generateRelativeTime(latest.created));
}, 1000);
useEffect(() => {
const interval = setInterval(() => setLatestTestTime(generateRelativeTime(latest.created)), 1000);
return () => {
clearInterval(interval);
};
}, [setLatestTestTime, latest]);
if (Object.entries(config).length === 0) return (<></>)