chore: remove isloading break ui

This commit is contained in:
Joel 2024-12-10 14:15:14 +08:00
parent d1743ee3e5
commit 430de3108b
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ const indexStateReducer = (state: IIndexState, action: IAction) => {
const RetryButton: FC<Props> = ({ datasetId }) => {
const { t } = useTranslation()
const [indexState, dispatch] = useReducer(indexStateReducer, { value: 'success' })
const { data: errorDocs } = useSWR({ datasetId }, getErrorDocs)
const { data: errorDocs, isLoading } = useSWR({ datasetId }, getErrorDocs)
const onRetryErrorDocs = async () => {
dispatch({ type: 'retry' })
@ -53,7 +53,7 @@ const RetryButton: FC<Props> = ({ datasetId }) => {
dispatch({ type: 'error' })
}, [errorDocs?.total])
if (indexState.value === 'success')
if (isLoading || indexState.value === 'success')
return null
return (