Skip to content

Commit 75815d0

Browse files
committed
fix(resume): update the per-context form cache outside the state updater
1 parent 37be210 commit 75815d0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,12 @@ export default function ResumeExecutionPage({
345345
const handleFormFieldChange = useCallback(
346346
(fieldName: string, newValue: string) => {
347347
if (!selectedContextId) return
348-
setFormValues((prev) => {
349-
const updated = { ...prev, [fieldName]: newValue }
350-
formValuesByContextRef.current[selectedContextId] = updated
351-
return updated
352-
})
348+
const updated = {
349+
...formValuesByContextRef.current[selectedContextId],
350+
[fieldName]: newValue,
351+
}
352+
formValuesByContextRef.current[selectedContextId] = updated
353+
setFormValues(updated)
353354
setFormErrors((prev) => {
354355
if (!prev[fieldName]) return prev
355356
const { [fieldName]: _, ...rest } = prev

0 commit comments

Comments
 (0)