Merge branch 'main' into feat/trigger

This commit is contained in:
lyzno1 2025-11-12 16:49:08 +08:00 committed by GitHub
commit 3ff14ccc89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { ModalContextProvider } from '@/context/modal-context'
import GotoAnything from '@/app/components/goto-anything'
import Zendesk from '@/app/components/base/zendesk'
import ReadmePanel from '@/app/components/plugins/readme-panel'
import Splash from '../components/splash'
const Layout = ({ children }: { children: ReactNode }) => {
return (
@ -27,6 +28,7 @@ const Layout = ({ children }: { children: ReactNode }) => {
{children}
<ReadmePanel />
<GotoAnything />
<Splash />
</ModalContextProvider>
</ProviderContextProvider>
</EventEmitterContextProvider>

View File

@ -0,0 +1,21 @@
'use client'
import type { FC, PropsWithChildren } from 'react'
import React from 'react'
import { useIsLogin } from '@/service/use-common'
import Loading from './base/loading'
const Splash: FC<PropsWithChildren> = () => {
// would auto redirect to signin page if not logged in
const { isLoading, data: loginData } = useIsLogin()
const isLoggedIn = loginData?.logged_in
if (isLoading || !isLoggedIn) {
return (
<div className='fixed inset-0 z-[9999999] flex h-full items-center justify-center bg-background-body'>
<Loading />
</div>
)
}
return null
}
export default React.memo(Splash)