ordering-ui-react-native 0.12.59 → 0.12.60

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.12.59",
3
+ "version": "0.12.60",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -10,8 +10,7 @@ import { useTheme } from 'styled-components/native';
10
10
  import { OText } from '../shared';
11
11
  import { AppleLoginParams } from '../../types';
12
12
 
13
- export const AppleLogin = (props : AppleLoginParams) => {
14
-
13
+ export const AppleLogin = (props: AppleLoginParams) => {
15
14
  const {
16
15
  notificationState,
17
16
  handleErrors,
@@ -55,7 +54,7 @@ export const AppleLogin = (props : AppleLoginParams) => {
55
54
  handleErrors && handleErrors(t('ERROR_LOGIN_APPLE', 'Error login with apple'))
56
55
  }
57
56
 
58
- } catch (error : any) {
57
+ } catch (error: any) {
59
58
  handleErrors && handleErrors(error.message)
60
59
  }
61
60
  } else {
@@ -70,15 +69,22 @@ export const AppleLogin = (props : AppleLoginParams) => {
70
69
  });
71
70
  const { code } = await appleAuthAndroid.signIn();
72
71
  handleLoginApple(code)
73
- } catch (error : any) {
72
+ } catch (error: any) {
74
73
  handleErrors && handleErrors(error?.message)
75
74
  }
76
75
  }
77
76
  }
78
77
  const handleLoginApple = async (code: string) => {
79
- const body: any = {
80
- code,
81
- platform: Platform.OS === 'ios' && 'ios'
78
+ let body: any
79
+ if (Platform.OS === 'ios') {
80
+ body = {
81
+ code,
82
+ platform: 'ios'
83
+ }
84
+ } else {
85
+ body = {
86
+ code
87
+ }
82
88
  }
83
89
  if (notificationState?.notification_token) {
84
90
  body.notification_token = notificationState.notification_token
@@ -99,7 +105,7 @@ export const AppleLogin = (props : AppleLoginParams) => {
99
105
  } else {
100
106
  handleErrors && handleErrors(result || t('ERROR_LOGIN_AUTH_APPLE', 'Error login auth with apple'))
101
107
  }
102
- } catch (error : any) {
108
+ } catch (error: any) {
103
109
  handleLoading && handleLoading(false)
104
110
  handleErrors && handleErrors(error?.message)
105
111
  }