From 5df70ebe8e41810b4c79aaa57396af4275170dfd Mon Sep 17 00:00:00 2001 From: Arash Date: Mon, 22 Apr 2024 09:59:28 +0200 Subject: [PATCH] Small fix on account removal page (#84) * use latest iOS SDK * Implement removeAccount function * Small fix on RemoveAccount --- mobile/src/screens/RemoveAccount.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/src/screens/RemoveAccount.tsx b/mobile/src/screens/RemoveAccount.tsx index bc00148..3827231 100644 --- a/mobile/src/screens/RemoveAccount.tsx +++ b/mobile/src/screens/RemoveAccount.tsx @@ -25,20 +25,21 @@ export function RemoveAccount() { const removeAccount = async () => { setIsLoading(true); + try { const response = await paymentsApi.delete("/api/customers"); if (response.status === 201) { showSuccessNotification("Account removed successfully"); } else { showErrorNotification( - "Account removal failed. please contact support." + "Account removal failed. Please contact support." ); } - auth?.logout(); } catch (error) { - showErrorNotification("Account removal failed. please contact support."); - auth?.logout(); + showErrorNotification("Account removal failed. Please contact support."); } + + auth?.logout(); setIsLoading(false); };