mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 09:39:25 +08:00
tweaks
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import Cookies from 'js-cookie'
|
||||
import { parseAsBoolean, useQueryState } from 'nuqs'
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { useCallback, useEffect } from 'react'
|
||||
import {
|
||||
EDUCATION_VERIFY_URL_SEARCHPARAMS_ACTION,
|
||||
EDUCATION_VERIFYING_LOCALSTORAGE_ITEM,
|
||||
@@ -29,7 +29,6 @@ export const AppInitializer = ({
|
||||
'oauth_new_user',
|
||||
parseAsBoolean.withOptions({ history: 'replace' }),
|
||||
)
|
||||
const [isReady, setIsReady] = useState(false)
|
||||
const isSetupFinished = useCallback(async () => {
|
||||
try {
|
||||
const setUpStatus = await fetchSetupStatusWithCache()
|
||||
@@ -87,11 +86,7 @@ export const AppInitializer = ({
|
||||
const redirectUrl = resolvePostLoginRedirect()
|
||||
if (redirectUrl) {
|
||||
location.replace(redirectUrl)
|
||||
return
|
||||
}
|
||||
|
||||
// Initialization completed without redirects; safe to render children
|
||||
setIsReady(true)
|
||||
}
|
||||
catch {
|
||||
router.replace('/signin')
|
||||
@@ -99,8 +94,5 @@ export const AppInitializer = ({
|
||||
})()
|
||||
}, [isSetupFinished, router, pathname, searchParams, oauthNewUser])
|
||||
|
||||
if (!isReady)
|
||||
return null
|
||||
|
||||
return children
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user