|
|
|
@ -478,12 +478,19 @@ export function QuestionAnswersProvider({ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const fullPayload = createPayload(answersRef.current, questionsRef.current, backendFieldsRef.current); |
|
|
|
const nextDirtyKey = fullPayload.fields.find((field) => dirtyKeysRef.current.has(field.key))?.key; |
|
|
|
const fullPayload = createPayload( |
|
|
|
answersRef.current, |
|
|
|
questionsRef.current, |
|
|
|
backendFieldsRef.current, |
|
|
|
); |
|
|
|
const nextDirtyKey = fullPayload.fields.find((field) => |
|
|
|
dirtyKeysRef.current.has(field.key), |
|
|
|
)?.key; |
|
|
|
const payload = { |
|
|
|
...fullPayload, |
|
|
|
fields: nextDirtyKey ? fullPayload.fields.filter((field) => field.key === nextDirtyKey) : [], |
|
|
|
version: schemaVersionRef.current, |
|
|
|
fields: nextDirtyKey |
|
|
|
? fullPayload.fields.filter((field) => field.key === nextDirtyKey) |
|
|
|
: [], |
|
|
|
}; |
|
|
|
const revision = answersRevisionRef.current; |
|
|
|
|
|
|
|
|