diff --git a/src/photo/form/PhotoForm.tsx b/src/photo/form/PhotoForm.tsx index 59d3422d..3f05f5f7 100644 --- a/src/photo/form/PhotoForm.tsx +++ b/src/photo/form/PhotoForm.tsx @@ -10,6 +10,7 @@ import { useState, } from 'react'; import { + FIELDS_TO_NOT_TOAST, FIELDS_WITH_JSON, FORM_METADATA_ENTRIES_BY_SECTION, FORM_SECTIONS, @@ -184,8 +185,10 @@ export default function PhotoForm({ setDetectedFilm(updatedExifData.film); } - if (changedKeys.length > 0) { - const fields = convertFormKeysToLabels(changedKeys); + const keysToToast = changedKeys.filter(key => + !FIELDS_TO_NOT_TOAST.includes(key)); + if (keysToToast.length > 0) { + const fields = convertFormKeysToLabels(keysToToast); toastSuccess(`Updated EXIF fields: ${fields.join(', ')}`, 8000); } else { toastWarning('No new EXIF data found'); diff --git a/src/photo/form/index.ts b/src/photo/form/index.ts index 4cfb744a..a1fded06 100644 --- a/src/photo/form/index.ts +++ b/src/photo/form/index.ts @@ -291,6 +291,11 @@ const FORM_METADATA = ( }, }); +export const FIELDS_TO_NOT_TOAST: (keyof PhotoFormData)[] = [ + 'colorData', + 'colorSort', +]; + export const FIELDS_WITH_JSON = Object.entries(FORM_METADATA()) .filter(([_, meta]) => meta.isJson) .map(([key]) => key as keyof PhotoFormData);