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
|
@@ -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
|
|
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
|
|
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
|
|
72
|
+
} catch (error: any) {
|
|
74
73
|
handleErrors && handleErrors(error?.message)
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
const handleLoginApple = async (code: string) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
|
108
|
+
} catch (error: any) {
|
|
103
109
|
handleLoading && handleLoading(false)
|
|
104
110
|
handleErrors && handleErrors(error?.message)
|
|
105
111
|
}
|