兼容旧报告卡片并保留追加内容
This commit is contained in:
parent
ca9fc9ee9d
commit
343c04530c
@ -313,13 +313,16 @@ function legacySolutionCards(result: RiskAssessmentResult): ReportCard[] {
|
||||
|
||||
function openReport(result: RiskAssessmentResult) {
|
||||
const stored = readStoredReport();
|
||||
const storedCards = stored
|
||||
? stored.reportCards?.length
|
||||
? stored.reportCards
|
||||
: legacySolutionCards(stored)
|
||||
: [];
|
||||
const merged: RiskAssessmentResult =
|
||||
stored?.subjectId === result.subjectId
|
||||
? {
|
||||
...structuredClone(result),
|
||||
reportCards: stored.reportCards?.length
|
||||
? stored.reportCards
|
||||
: result.reportCards ?? [],
|
||||
reportCards: storedCards.length ? storedCards : result.reportCards ?? [],
|
||||
aiSolutionCards: stored.aiSolutionCards?.length
|
||||
? stored.aiSolutionCards
|
||||
: result.aiSolutionCards ?? [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user