mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-19 10:43:43 +08:00
Integrate AutoSync component into layout
Added AutoSync component within ThemeProvider for background synchronization.
This commit is contained in:
@@ -3,6 +3,7 @@ import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ThemeProvider } from "@/components/ThemeProvider";
|
||||
import { AutoSync } from '@/components/AutoSync'; // <-- 引入了自动同步组件
|
||||
import { TVProvider } from "@/lib/contexts/TVContext";
|
||||
import { TVNavigationInitializer } from "@/components/TVNavigationInitializer";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
@@ -15,6 +16,7 @@ import { ScrollPositionManager } from "@/components/ScrollPositionManager";
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
|
||||
// Server Component specifically for reading env/file (async for best practices)
|
||||
async function AdKeywordsWrapper() {
|
||||
let keywords: string[] = [];
|
||||
@@ -97,6 +99,9 @@ export default function RootLayout({
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<ThemeProvider>
|
||||
{/* 加入自动同步组件,它会在后台默默工作,我们放在 ThemeProvider 内部的最前面 */}
|
||||
<AutoSync />
|
||||
|
||||
<TVProvider>
|
||||
<TVNavigationInitializer />
|
||||
<PasswordGate hasAuth={!!(process.env.ADMIN_PASSWORD || process.env.ACCOUNTS || process.env.ACCESS_PASSWORD)}>
|
||||
|
||||
Reference in New Issue
Block a user