MCPcopy Create free account
hub / github.com/HisMax/RedInk / updateImage

Function updateImage

frontend/src/stores/generator.ts:329–342  ·  view source on GitHub ↗

* 更新指定图片的URL * @param index 页面索引 * @param newUrl 新的图片URL

(index: number, newUrl: string)

Source from the content-addressed store, hash-verified

327 * @param newUrl 新的图片URL
328 */
329 updateImage(index: number, newUrl: string) {
330 const image = this.images.find(img => img.index === index)
331 if (image) {
332 const wasDone = image.status === 'done'
333 // 添加时间戳避免缓存
334 const timestamp = Date.now()
335 image.url = `${newUrl}?t=${timestamp}`
336 image.status = 'done'
337 delete image.error
338 if (!wasDone && this.progress.current < this.progress.total) {
339 this.progress.current++
340 }
341 }
342 },
343
344 /**
345 * 完成图片生成流程

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected