优化认证检查逻辑,确保加载状态显示在正确位置;更新配置验证逻辑,使用深拷贝确保数据完整性

This commit is contained in:
DrSmoothl
2026-03-07 21:52:23 +08:00
parent 2e4be9bd77
commit 0451a7fef4
3 changed files with 21 additions and 19 deletions

View File

@@ -94,15 +94,6 @@ export function Layout({ children }: LayoutProps) {
return unsubscribe
}, [router, announce, t])
// 认证检查中,显示加载状态
if (checking) {
return (
<div className="flex h-screen items-center justify-center bg-background">
<div className="text-muted-foreground">{t('layout.verifyingLogin')}</div>
</div>
)
}
// 获取实际应用的主题(处理 system 情况)
const getActualTheme = () => {
if (theme === 'system') {
@@ -114,6 +105,15 @@ export function Layout({ children }: LayoutProps) {
const actualTheme = getActualTheme()
const pageBg = useBackground('page')
// 认证检查中,显示加载状态
if (checking) {
return (
<div className="flex h-screen items-center justify-center bg-background">
<div className="text-muted-foreground">{t('layout.verifyingLogin')}</div>
</div>
)
}
return (
<TooltipProvider delayDuration={300}>
<SkipNav />