From b3d9a31e25f0e59997a874d180d6a9d2ba69e0a2 Mon Sep 17 00:00:00 2001 From: vvwn <39298624+vvwn@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:38:32 +0800 Subject: [PATCH] Integrate AutoSync component into layout Added AutoSync component within ThemeProvider for background synchronization. --- app/layout.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/layout.tsx b/app/layout.tsx index 2baf886..84ba96e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -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 内部的最前面 */} + +