From f44b05c788173b005416e0f5942ffece17220863 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 28 Aug 2024 10:16:35 -1000 Subject: [PATCH] Use optional chaining fo backTo on NewContactMethodPage --- src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx index 945a1155c528..3380766d0ecf 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx @@ -47,9 +47,9 @@ function NewContactMethodPage({loginList, route}: NewContactMethodPageProps) { const validateIfnumber = LoginUtils.validateNumber(phoneLogin); const submitDetail = (validateIfnumber || values.phoneOrEmail).trim().toLowerCase(); - User.addNewContactMethodAndNavigate(submitDetail, route.params.backTo); + User.addNewContactMethodAndNavigate(submitDetail, route.params?.backTo); }, - [route.params.backTo], + [route.params?.backTo], ); const validate = React.useCallback(