ordering-ui-react-native 0.23.64 → 0.23.65
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
|
@@ -85,7 +85,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
85
85
|
const [, { showToast }] = useToast();
|
|
86
86
|
const { handleSubmit, control, errors, setValue } = useForm();
|
|
87
87
|
|
|
88
|
-
const [{ user }, { login }] = useSession();
|
|
88
|
+
const [{ user }, { login, logout }] = useSession();
|
|
89
89
|
const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
|
|
90
90
|
const [isValid, setIsValid] = useState(false)
|
|
91
91
|
const [isChanged, setIsChanged] = useState(false)
|
|
@@ -247,9 +247,12 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
247
247
|
open: true,
|
|
248
248
|
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
249
249
|
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
250
|
-
handleOnAccept: () => {
|
|
250
|
+
handleOnAccept: async () => {
|
|
251
251
|
setConfirm({ ...confirm, open: false })
|
|
252
|
-
|
|
252
|
+
const response = await handleRemoveAccount?.(user?.id)
|
|
253
|
+
if (response === 'OK'){
|
|
254
|
+
logout()
|
|
255
|
+
}
|
|
253
256
|
}
|
|
254
257
|
})
|
|
255
258
|
}
|
|
@@ -355,7 +358,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
355
358
|
isDisabled={false}
|
|
356
359
|
value={
|
|
357
360
|
formState?.changes[field.code] ??
|
|
358
|
-
(user && user?.guest_id && field.code === 'email' ? user?.guest_email : user[field.code]) ??
|
|
361
|
+
(user && user?.guest_id && field.code === 'email' ? user?.guest_email : user?.[field.code]) ??
|
|
359
362
|
''
|
|
360
363
|
}
|
|
361
364
|
onChange={(val: any) => {
|
|
@@ -399,7 +402,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
399
402
|
)}
|
|
400
403
|
name={field.code}
|
|
401
404
|
rules={getInputRules(field)}
|
|
402
|
-
defaultValue={user && (field.code === 'email' && user?.guest_id ? user?.guest_email : user[field.code])}
|
|
405
|
+
defaultValue={user && (field.code === 'email' && user?.guest_id ? user?.guest_email : user?.[field.code])}
|
|
403
406
|
/>
|
|
404
407
|
</React.Fragment>
|
|
405
408
|
))
|