diff --git a/src/action/callRecordingActions.ts b/src/action/callRecordingActions.ts index 45b77ec7..08957c35 100644 --- a/src/action/callRecordingActions.ts +++ b/src/action/callRecordingActions.ts @@ -1,6 +1,9 @@ import axiosInstance, { ApiKeys, getApiUrl } from '@components/utlis/apiHelper'; import { logError } from '@components/utlis/errorUtils'; +import { navigateToScreen } from '@components/utlis/navigationUtlis'; import { setConnectingToCustomerBottomSheet } from '@reducers/activeCallSlice'; +import { toast } from '@rn-ui-lib/components/toast'; +import { BOTTOM_TAB_ROUTES } from '@screens/allCases/constants'; import { AppDispatch } from '@store'; export const makeACallToCustomer = (payload: any) => (dispatch: AppDispatch) => { @@ -10,6 +13,13 @@ export const makeACallToCustomer = (payload: any) => (dispatch: AppDispatch) => .post(url, payload) .then((res) => {}) .catch((err: Error) => { + dispatch(setConnectingToCustomerBottomSheet(false)); + toast({ + type: 'error', + onPress: () => navigateToScreen(BOTTOM_TAB_ROUTES.Profile), + text1: 'Call failed! Please retry calling Abhinav bindra upadhyaya again', + visibilityTime: 10000, + }); logError(err); }) .finally(() => {});