fix: 共享去重显示具体差异内容
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 5s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Failing after 53s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 20:15:12 +00:00
parent 6d2620eb6a
commit 9e15e1beed

View File

@@ -1285,9 +1285,11 @@ async function shareDiaryToPublic(diary) {
ui.showToast('公共配方库中已有一模一样的配方「' + diary.name + '」') ui.showToast('公共配方库中已有一模一样的配方「' + diary.name + '」')
return return
} }
// Same name, different content // Same name, different content — show details
const existIngs = pIngs.map(i => `${i.oil}${i.drops}`).join('、')
const newIngs = dIngs.map(i => `${i.oil}${i.drops}`).join('、')
const action = await showConfirm( const action = await showConfirm(
`公共配方库中已有同名配方「${diary.name}内容不同是否改名后共享?`, `公共配方库中已有同名配方「${diary.name}内容不同\n\n已有${existIngs}\n新的${newIngs}\n\n是否改名后共享?`,
{ okText: '改名', cancelText: '取消' } { okText: '改名', cancelText: '取消' }
) )
if (!action) return if (!action) return