ordering-ui-react-native 0.21.23 → 0.21.25
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
|
@@ -96,10 +96,10 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
96
96
|
handlePlayNotificationSound({ evt: 2, orderId: value?.id })
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
if (evtType === 3 || value
|
|
99
|
+
if (evtType === 3 || value?.author_id === user.id) return
|
|
100
100
|
setTimeout(() => handlePlayNotificationSound({
|
|
101
101
|
evt: evtType,
|
|
102
|
-
orderId: value?.driver ? value?.order_id : evtList[evtType].event === 'messages' ? value?.order?.id : value?.order_id
|
|
102
|
+
orderId: value?.driver ? value?.order_id : evtList[evtType].event === 'messages' ? value?.order?.id : value?.order_id ?? value?.id
|
|
103
103
|
}), 1000)
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -158,12 +158,13 @@ const CheckoutUI = (props: any) => {
|
|
|
158
158
|
const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
|
|
159
159
|
const [isOpen, setIsOpen] = useState(false)
|
|
160
160
|
const [requiredFields, setRequiredFields] = useState<any>([])
|
|
161
|
-
const [openModal, setOpenModal] = useState({ login: false, signup: false })
|
|
161
|
+
const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
|
|
162
162
|
const [allowedGuest, setAllowedGuest] = useState(false)
|
|
163
163
|
const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
|
|
164
164
|
const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
|
|
165
165
|
const [cardList, setCardList] = useState<any>({ cards: [], loading: false, error: null })
|
|
166
166
|
const cardsMethods = ['credomatic']
|
|
167
|
+
const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
|
|
167
168
|
const placeSpotTypes = [3, 4, 5]
|
|
168
169
|
const placeSpotsEnabled = placeSpotTypes.includes(options?.type)
|
|
169
170
|
const isGiftCardCart = !cart?.business_id
|
|
@@ -237,7 +238,8 @@ const CheckoutUI = (props: any) => {
|
|
|
237
238
|
user,
|
|
238
239
|
token: user?.session?.access_token
|
|
239
240
|
})
|
|
240
|
-
|
|
241
|
+
openModal?.isGuest && handlePlaceOrderAsGuest()
|
|
242
|
+
setOpenModal({ ...openModal, signup: false, isGuest: false })
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
const handleSuccessLogin = (user: any) => {
|
|
@@ -245,6 +247,11 @@ const CheckoutUI = (props: any) => {
|
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
const handlePlaceOrder = (confirmPayment: any, forcePlace: boolean = false) => {
|
|
250
|
+
if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
|
|
251
|
+
setOpenModal({ ...openModal, signup: true, isGuest: true })
|
|
252
|
+
return
|
|
253
|
+
}
|
|
254
|
+
|
|
248
255
|
if (!userErrors.length && (!requiredFields?.length || allowedGuest) || forcePlace) {
|
|
249
256
|
vibrateApp()
|
|
250
257
|
handlerClickPlaceOrder && handlerClickPlaceOrder(null, { isNative: true }, confirmPayment)
|
|
@@ -927,7 +934,7 @@ const CheckoutUI = (props: any) => {
|
|
|
927
934
|
</OModal>
|
|
928
935
|
<OModal
|
|
929
936
|
open={openModal.signup}
|
|
930
|
-
onClose={() => setOpenModal({ ...openModal, signup: false })}
|
|
937
|
+
onClose={() => setOpenModal({ ...openModal, signup: false, isGuest: false })}
|
|
931
938
|
>
|
|
932
939
|
<ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
|
|
933
940
|
<SignupForm
|