ordering-ui-react-native 0.23.56 → 0.23.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.23.56",
3
+ "version": "0.23.57",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -266,7 +266,9 @@ const CheckoutUI = (props: any) => {
266
266
  user,
267
267
  token: user?.session?.access_token
268
268
  })
269
- openModal?.isGuest && handlePlaceOrderAsGuest()
269
+ if (openModal?.isGuest && requiredFields?.length === 0) {
270
+ openModal?.isGuest && handlePlaceOrderAsGuest()
271
+ }
270
272
  setOpenModal({ ...openModal, signup: false, isGuest: false })
271
273
  }
272
274
 
@@ -409,12 +411,14 @@ const CheckoutUI = (props: any) => {
409
411
  }, [errors])
410
412
 
411
413
  useEffect(() => {
412
- if (cart?.products?.length === 0) {
413
- if (cart?.business_id !== null) {
414
- onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null, fromMulti: props.fromMulti })
415
- } else if (isGiftCardCart) {
416
- onNavigationRedirect('Wallets')
417
- }
414
+ if (cart?.products?.length === 0 || !userLoading) return
415
+ if (cart?.business_id !== null) {
416
+ onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null, fromMulti: props.fromMulti })
417
+ return
418
+ }
419
+ if (isGiftCardCart) {
420
+ onNavigationRedirect('Wallets')
421
+ return
418
422
  }
419
423
  }, [cart?.products?.length])
420
424
 
@@ -87,7 +87,7 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
87
87
  error: '',
88
88
  phone: {
89
89
  country_phone_code: callingCode,
90
- cellphone: !isDisableNumberValidation ? userphoneNumber : formattedNumber?.number
90
+ cellphone: !isDisableNumberValidation ? cellphone.slice(callingCode?.length) : formattedNumber?.number
91
91
  }
92
92
  })
93
93
  } else {