diff --git a/src/features/subject-identity/useSubjectIdentity.ts b/src/features/subject-identity/useSubjectIdentity.ts index ae8fb44..3448284 100644 --- a/src/features/subject-identity/useSubjectIdentity.ts +++ b/src/features/subject-identity/useSubjectIdentity.ts @@ -80,7 +80,13 @@ export function useSubjectIdentity() { ) const subject = computed(() => subjects.value.find(item => item.id === selectedId.value)) const selectionKey = computed(() => subject.value?.id ?? '') - const detail = usePolling( + let detail!: ReturnType> + const detailPollInterval = computed(() => + detail?.data.value?.images.some(image => image.status === 'pending' || image.status === 'generating') + ? 4000 + : false + ) + detail = usePolling( selectionKey, async (id, signal) => { if (!id) return null @@ -91,7 +97,7 @@ export function useSubjectIdentity() { if (images.some(image => image.identityId !== identity.id)) throw new Error('身份图片与当前主体不匹配。') return { identity, images } }, - false + detailPollInterval ) const identity = computed(() => detail.data.value?.identity ?? null) const images = computed(() => detail.data.value?.images ?? [])