This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import PartnershipSourceLinks from './partnership-source-links';
|
||||
import {
|
||||
getAutosaveSnapshot,
|
||||
partitionSimulationDraft,
|
||||
@@ -1053,6 +1054,7 @@ export function SimulationForm() {
|
||||
let cancelled = false;
|
||||
void (async () => {
|
||||
let local: SimulationDraft = {};
|
||||
const requestedDraftId = new URLSearchParams(window.location.search).get('draft');
|
||||
try {
|
||||
const stored = sessionStorage.getItem(draftKey);
|
||||
if (stored) local = JSON.parse(stored) as SimulationDraft;
|
||||
@@ -1063,7 +1065,7 @@ export function SimulationForm() {
|
||||
}
|
||||
try {
|
||||
const response = await fetch(
|
||||
'/api/v1/simulation-drafts/current',
|
||||
requestedDraftId ? `/api/v1/simulation-drafts/${encodeURIComponent(requestedDraftId)}` : '/api/v1/simulation-drafts/current',
|
||||
{
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
@@ -1110,7 +1112,7 @@ export function SimulationForm() {
|
||||
setSelectedAccountDraftId(
|
||||
listPayload.data[0]?.id ?? '',
|
||||
);
|
||||
if (previewPayload.data) {
|
||||
if (previewPayload.data && !requestedDraftId) {
|
||||
setPendingAnonymousDraft(previewPayload.data);
|
||||
setShowDraftChoice(true);
|
||||
setSaveStatus(
|
||||
@@ -2104,6 +2106,7 @@ export function SimulationForm() {
|
||||
className="space-y-6 rounded-xl border bg-white p-4 sm:p-6"
|
||||
aria-labelledby="simulator-step-title"
|
||||
>
|
||||
{canSavePersonalData && draftVersionNo && draftIdRef.current && <PartnershipSourceLinks type="simulation" id={draftIdRef.current}/>}
|
||||
<div className="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h2
|
||||
|
||||
Reference in New Issue
Block a user