From 4be765171635b3fe687031453cdd1ab592b82659 Mon Sep 17 00:00:00 2001 From: reagan-meant Date: Mon, 28 Oct 2024 23:10:20 +0300 Subject: [PATCH] SSGSO-5: Add phone number by default --- .../src/smsform/send-sms-form.component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/esm-patient-outcomes-app/src/smsform/send-sms-form.component.tsx b/packages/esm-patient-outcomes-app/src/smsform/send-sms-form.component.tsx index 3b60609..13ae8bd 100644 --- a/packages/esm-patient-outcomes-app/src/smsform/send-sms-form.component.tsx +++ b/packages/esm-patient-outcomes-app/src/smsform/send-sms-form.component.tsx @@ -52,8 +52,9 @@ const SendSmsForm: React.FC = ({ } = methods; useEffect(() => { + patient?.telecom[0]?.value ? methods.setValue('to', patient?.telecom[0]?.value) : null; promptBeforeClosing(() => isDirty); - }, [isDirty, promptBeforeClosing]); + }, [isDirty, promptBeforeClosing, patient]); const onSubmit = useCallback( (data: SmsFormData, event: any) => {