Add Void difficulty and publish changelogs
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m40s
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m40s
This commit is contained in:
19
components/ChangelogRefresh.tsx
Normal file
19
components/ChangelogRefresh.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export function ChangelogRefresh() {
|
||||
const router = useRouter();
|
||||
useEffect(() => {
|
||||
const refresh = () => {
|
||||
if (document.visibilityState === "visible") router.refresh();
|
||||
};
|
||||
const timer = window.setInterval(refresh, 65_000);
|
||||
document.addEventListener("visibilitychange", refresh);
|
||||
return () => {
|
||||
window.clearInterval(timer);
|
||||
document.removeEventListener("visibilitychange", refresh);
|
||||
};
|
||||
}, [router]);
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user