Fix JSON parse issue when syncing recipe data

This commit is contained in:
Sam Becker 2025-03-21 19:09:21 -05:00
parent 4aa3739c9a
commit f3dfb8ddf8

View File

@ -108,8 +108,8 @@ export default function PhotoForm({
let a = currentForm[key]; let a = currentForm[key];
let b = value; let b = value;
if (FIELDS_WITH_JSON.includes(key)) { if (FIELDS_WITH_JSON.includes(key)) {
a = JSON.parse(a ?? ''); a = a ? JSON.parse(a) : undefined;
b = JSON.parse(b ?? ''); b = b ? JSON.parse(b) : undefined;
} }
if (!deepEqual(a, b)) { if (!deepEqual(a, b)) {
changedKeys.push(key as keyof PhotoFormData); changedKeys.push(key as keyof PhotoFormData);