wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
app/components/swr-initor.tsx
@@ -5,10 +5,6 @@
import type { ReactNode } from 'react'
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
import { fetchSetupStatus } from '@/service/common'
import {
  EDUCATION_VERIFYING_LOCALSTORAGE_ITEM,
  EDUCATION_VERIFY_URL_SEARCHPARAMS_ACTION,
} from '@/app/education-apply/constants'
type SwrInitorProps = {
  children: ReactNode
@@ -45,11 +41,6 @@
  useEffect(() => {
    (async () => {
      const action = searchParams.get('action')
      if (action === EDUCATION_VERIFY_URL_SEARCHPARAMS_ACTION)
        localStorage.setItem(EDUCATION_VERIFYING_LOCALSTORAGE_ITEM, 'yes')
      try {
        const isFinished = await isSetupFinished()
        if (!isFinished) {
@@ -68,7 +59,7 @@
        setInit(true)
      }
      catch {
      catch (error) {
        router.replace('/signin')
      }
    })()