Skip to content

Commit b2a9d51

Browse files
committed
Correct tainted check on update
1 parent 312db12 commit b2a9d51

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/lib/client/index.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,30 +418,20 @@ export function superForm<
418418
taintedFormState,
419419
options
420420
);
421+
const output = updater(value);
421422
if (
422423
options.taint !== false &&
423424
!get(Submitting) &&
424425
taintedFormState
425426
) {
426-
checkTainted(value, taintedFormState);
427+
checkTainted(output, taintedFormState);
427428
}
428429
taintedFormState = clone(value);
429-
return updater(value);
430+
return output;
430431
});
431432
}
432433
};
433434

434-
/*
435-
unsubscriptions.push(
436-
Form.subscribe(async (data) => {
437-
if (!get(Submitting) && taintedFormState) {
438-
checkTainted(data, taintedFormState);
439-
}
440-
taintedFormState = clone(data);
441-
})
442-
);
443-
*/
444-
445435
const LastChanges = writable<string[][]>([]);
446436

447437
function checkTainted(newObj: unknown, compareAgainst: unknown) {

0 commit comments

Comments
 (0)