fix: 修正动态轮询引用声明
This commit is contained in:
1 parent
fde02144db
commit
ed9035329e
1 file changed
+4
-3
@@ -34,9 +34,9 @@ export function useSubjectImages() {
|
|||||||
async (projectId, signal) => ({ profile: await generationConfigApi.profile(projectId, signal) }),
|
async (projectId, signal) => ({ profile: await generationConfigApi.profile(projectId, signal) }),
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
let query!: ReturnType<typeof usePolling<Awaited<ReturnType<typeof subjectImagesApi.listForms>>>>
|
const queryRef = {} as { current?: ReturnType<typeof usePolling<Awaited<ReturnType<typeof subjectImagesApi.listForms>>>> }
|
||||||
const pollInterval = computed(() => queryDataHasRunningImages(query?.data.value ?? null) ? 4000 : false)
|
const pollInterval = computed(() => queryDataHasRunningImages(queryRef.current?.data.value ?? null) ? 4000 : false)
|
||||||
query = usePolling(
|
const query = usePolling(
|
||||||
id,
|
id,
|
||||||
async (projectId, signal) => {
|
async (projectId, signal) => {
|
||||||
if (!projectId) return []
|
if (!projectId) return []
|
||||||
@@ -62,6 +62,7 @@ export function useSubjectImages() {
|
|||||||
},
|
},
|
||||||
pollInterval
|
pollInterval
|
||||||
)
|
)
|
||||||
|
queryRef.current = query
|
||||||
const forms = computed(() => query.data.value ?? [])
|
const forms = computed(() => query.data.value ?? [])
|
||||||
const operation = computed(() => getOperation(id.value))
|
const operation = computed(() => getOperation(id.value))
|
||||||
const session = computed(() => getImageSession(id.value))
|
const session = computed(() => getImageSession(id.value))
|
||||||
|
|||||||
Reference in new issue
Block a user