diff --git a/src/components/ECGList/index.jsx b/src/components/ECGList/index.jsx index 04dc2fe..6c8242d 100644 --- a/src/components/ECGList/index.jsx +++ b/src/components/ECGList/index.jsx @@ -64,8 +64,6 @@ export default function ECGList() { let n = 5; while (ecg.component[n].valueString !== undefined){ const new_symptom = ecg.component[n].code.coding[0].display - console.log(`${new_symptom} exists.`); - symptom = `${symptom}, ${new_symptom}` n += 1; } @@ -100,13 +98,6 @@ export default function ECGList() { const updatedRowData = [...diagnoses]; updatedRowData[index] = selectedItem; setDiagnoses(updatedRowData); - - if (typeof selectedItem === 'string') { - console.log('The field is a string.'); - } else { - console.log('The field is not a string.'); - } - console.log('Selected Item:', selectedItem); } function handleQualityDropdownChange(index, event) { @@ -153,8 +144,9 @@ export default function ECGList() { console.log('Fields added to the document successfully'); } + handleSaveButtonClick(ECG_ID); // change Row to green only if save is complete } catch (error) { - console.error('Error adding fields to the document:', error); + console.error('Error adding fields to the document: ', error); } }; @@ -162,8 +154,12 @@ export default function ECGList() { console.log(`Row ${index + 1} saved: ${names[index]}`); console.log(`Row ${index + 1} saved: ${diagnoses[index]}`); console.log(`Row ${index + 1} saved: ${qualities[index]}`); - diagnosisToFirebase(names[index], diagnoses[index], qualities[index], ECG_ID) - }; + try { + diagnosisToFirebase(names[index], diagnoses[index], qualities[index], ECG_ID) + } catch (error) { + } + } + ; useEffect(() => { const getEcgs = async () => { @@ -305,7 +301,6 @@ export default function ECGList() { sx={{ width: 100, margin: 2 }} style={{ backgroundColor: '#10AD92' }} onClick={(event) => { handleSave(index, ecg.id); - handleSaveButtonClick(ecg.id); }}> Save