refactor & perf: import { noop } from 'lodash-es' across web (#17439)

This commit is contained in:
yusheng chen 2025-04-06 17:56:08 +08:00 • committed by GitHub
commit c05e03fc09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
87 changed files with 271 additions and 184 deletions

View file

@ -24,6 +24,7 @@ import { useProviderContext } from '@/context/provider-context'
import { useToastContext } from '@/app/components/base/toast'
import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/constants'
import { getLocaleOnClient } from '@/i18n'
import { noop } from 'lodash-es'
const EducationApplyAge = () => {
const { t } = useTranslation()
@ -35,7 +36,7 @@ const EducationApplyAge = () => {
const {
isPending,
mutateAsync: educationAdd,
} = useEducationAdd({ onSuccess: () => {} })
} = useEducationAdd({ onSuccess: noop })
const [modalShow, setShowModal] = useState<undefined | { title: string; desc: string; onConfirm?: () => void }>(undefined)
const { onPlanInfoChanged } = useProviderContext()
const updateEducationStatus = useInvalidateEducationStatus()
@ -181,8 +182,8 @@ const EducationApplyAge = () => {
isShow={!!modalShow}
title={modalShow?.title || ''}
content={modalShow?.desc}
onConfirm={modalShow?.onConfirm || (() => {})}
onCancel={modalShow?.onConfirm || (() => {})}
onConfirm={modalShow?.onConfirm || noop}
onCancel={modalShow?.onConfirm || noop}
/>
</div>
)