Refactor KeepOnline logic and add useKeepOnline hook
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.
This commit is contained in:
@@ -3,9 +3,9 @@ import "./globals.css"
|
||||
import { ThemeProvider } from "@/components/layout/theme-provider"
|
||||
import { Toaster } from "sonner"
|
||||
import type React from "react"
|
||||
import KeepOnline from "@/components/KeepOnline"
|
||||
import { NotificationProvider } from "@/lib/notification-context"
|
||||
import { Metadata, Viewport } from "next"
|
||||
import KeepOnlineWrapper from "@/components/layout/KeepOnlineWrapper"
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] })
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function RootLayout({
|
||||
richColors
|
||||
position="top-right"
|
||||
/>
|
||||
<KeepOnline />
|
||||
<KeepOnlineWrapper />
|
||||
{children}
|
||||
</NotificationProvider>
|
||||
</ThemeProvider>
|
||||
|
||||
Reference in New Issue
Block a user