Moved dashboard path check from KeepOnline to a new KeepOnlineWrapper component for cleaner separation of concerns. Introduced a reusable useKeepOnline hook to encapsulate the online status update logic. Updated layout to use KeepOnlineWrapper and simplified KeepOnline. Minor cleanup in broadcast-dialog.tsx.
17 lines
312 B
TypeScript
17 lines
312 B
TypeScript
"use client";
|
|
|
|
import { useKeepOnline } from "@/hooks/useKeepOnline";
|
|
|
|
const KeepOnline = () => {
|
|
useKeepOnline({
|
|
interval: 1000 * 60 * 1, // 1 minute
|
|
enabled: true,
|
|
onError: (error) => {
|
|
console.error("Keep online error:", error);
|
|
}
|
|
});
|
|
|
|
return null;
|
|
}
|
|
|
|
export default KeepOnline; |