fix: 不在打开卡片时自动跑html2canvas,改为保存时按需生成
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Failing after 3m19s
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Failing after 3m19s
根本原因: html2canvas在CI headless Electron环境会无限挂起, 导致recipe-detail测试卡死。改为只在用户点"保存图片"时才生成。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -829,7 +829,7 @@ onMounted(() => {
|
||||
else { selectedVolume.value = 'custom'; customVolumeValue.value = Math.round(ml) }
|
||||
|
||||
loadBrand()
|
||||
nextTick(() => generateCardImage())
|
||||
// Don't auto-generate card image on mount — generate on demand when saving
|
||||
})
|
||||
|
||||
function addIngredient() {
|
||||
|
||||
@@ -656,12 +656,8 @@ async function openOilDetail(name) {
|
||||
activeCard.value = card
|
||||
selectedOilName.value = null
|
||||
loadBrand()
|
||||
// Pre-generate card image for instant save
|
||||
// Generate image on demand when saving, not on open
|
||||
oilCardImageUrl.value = null
|
||||
await nextTick()
|
||||
await new Promise(r => setTimeout(r, 300))
|
||||
const el = document.querySelector('.oil-card-modal')
|
||||
if (el) await generateImageFromRef({ value: el }, oilCardImageUrl)
|
||||
} else {
|
||||
activeCard.value = null
|
||||
activeCardName.value = null
|
||||
|
||||
Reference in New Issue
Block a user