Fix sorting of order table, and keepOnline to thefront

This commit is contained in:
g
2025-02-09 01:43:24 +00:00
parent dc30150760
commit 7ec17cfd73
3 changed files with 32 additions and 6 deletions

24
components/KeepOnline.ts Normal file
View File

@@ -0,0 +1,24 @@
"use client";
import { useEffect } from "react";
import { clientFetch } from "@/lib/client-utils";
const KeepOnline = () => {
useEffect(() => {
if(window.location.pathname.includes("/dashboard")){
const updateOnlineStatus = () => {
console.log("Updating online status...");
clientFetch("/auth/me");
}
updateOnlineStatus();
const interval = setInterval(updateOnlineStatus, 1000*60*1);
return () => clearInterval(interval);
}
}, []);
return null;
}
export default KeepOnline;