fix: 修正动态轮询引用声明
This commit is contained in:
1 parent
c07325a955
commit
fde02144db
1 file changed
+4
-3
@@ -80,13 +80,13 @@ export function useSubjectIdentity() {
|
||||
)
|
||||
const subject = computed(() => subjects.value.find(item => item.id === selectedId.value))
|
||||
const selectionKey = computed(() => subject.value?.id ?? '')
|
||||
let detail!: ReturnType<typeof usePolling<{ identity: SubjectIdentity | null; images: IdentityImage[] }>>
|
||||
const detailRef = {} as { current?: ReturnType<typeof usePolling<{ identity: SubjectIdentity | null; images: IdentityImage[] }>> }
|
||||
const detailPollInterval = computed(() =>
|
||||
detail?.data.value?.images.some(image => image.status === 'pending' || image.status === 'generating')
|
||||
detailRef.current?.data.value?.images.some(image => image.status === 'pending' || image.status === 'generating')
|
||||
? 4000
|
||||
: false
|
||||
)
|
||||
detail = usePolling(
|
||||
const detail = usePolling(
|
||||
selectionKey,
|
||||
async (id, signal) => {
|
||||
if (!id) return null
|
||||
@@ -99,6 +99,7 @@ export function useSubjectIdentity() {
|
||||
},
|
||||
detailPollInterval
|
||||
)
|
||||
detailRef.current = detail
|
||||
const identity = computed(() => detail.data.value?.identity ?? null)
|
||||
const images = computed(() => detail.data.value?.images ?? [])
|
||||
const castingItem = computed(() =>
|
||||
|
||||
Reference in new issue
Block a user