ordering-ui-react-native 0.15.87-release → 0.15.88-release

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.15.87-release",
3
+ "version": "0.15.88-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -805,16 +805,23 @@ export const Checkout = (props: any) => {
805
805
 
806
806
  const getOrder = async (cartId: any) => {
807
807
  try {
808
- setCartState({ ...cartState, loading: true })
809
- const url = `${ordering.root}/carts/${cartId}`
810
- const response = await fetch(url, {
811
- method: 'GET',
812
- headers: {
813
- 'Content-Type': 'application/json',
814
- Authorization: `Bearer ${token}`
815
- }
816
- })
817
- const { result } = await response.json();
808
+ let result: any = {}
809
+ const cart = orderState?.carts.find((cart: any) => cart.uuid === cartId)
810
+ if (cart) {
811
+ result = { ...cart }
812
+ } else {
813
+ setCartState({ ...cartState, loading: true })
814
+ const url = `${ordering.root}/carts/${cartId}`
815
+ const response = await fetch(url, {
816
+ method: 'GET',
817
+ headers: {
818
+ 'Content-Type': 'application/json',
819
+ Authorization: `Bearer ${token}`
820
+ }
821
+ })
822
+ const content = await response.json();
823
+ result = content.result
824
+ }
818
825
 
819
826
  let publicKey = null
820
827
  try {
@@ -610,7 +610,6 @@ const SignupFormUI = (props: SignupParams) => {
610
610
  }
611
611
  })}
612
612
  forwardRef={phoneRef}
613
- defaultCode={formState?.country_code ?? formState?.country_phone_code ?? null}
614
613
  changeCountry={(val: any) => setPhoneInputData({
615
614
  ...phoneInputData,
616
615
  phone: {