Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
c2bfaff4
Commit
c2bfaff4
authored
Oct 10, 2021
by
Ahmad Izzudin Alifyandra
Browse files
fix: register transition bug
parent
9bc7b5f2
Pipeline
#86287
passed with stage
in 9 minutes and 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/redux/user/actions.tsx
View file @
c2bfaff4
...
@@ -73,24 +73,19 @@ export const signupUser = (
...
@@ -73,24 +73,19 @@ export const signupUser = (
businessType
:
string
businessType
:
string
)
=>
{
)
=>
{
return
async
(
dispatch
:
Dispatch
<
any
>
)
=>
{
return
async
(
dispatch
:
Dispatch
<
any
>
)
=>
{
try
{
const
userAuth
=
await
authService
.
signUpAuth
(
email
,
password
);
const
userAuth
=
await
authService
.
signUpAuth
(
email
,
password
);
const
uid
=
userAuth
.
user
.
uid
;
const
uid
=
userAuth
.
user
.
uid
;
await
userService
.
createUser
(
uid
,
{
await
userService
.
createUser
(
uid
,
{
firstName
,
firstName
,
lastName
,
lastName
,
email
,
email
,
phone
,
phone
,
businessType
,
businessType
,
pic
:
""
,
pic
:
""
,
});
});
return
dispatch
({
return
dispatch
({
type
:
"
SIGNUP
"
,
type
:
"
SIGNUP
"
,
payload
:
{
email
,
firstName
,
lastName
,
id
:
uid
,
phone
,
businessType
},
payload
:
{
email
,
firstName
,
lastName
,
id
:
uid
,
phone
,
businessType
},
});
});
}
catch
(
e
)
{
console
.
log
(
e
);
return
{
error
:
e
};
}
};
};
};
};
src/screens/auth/RegisterScreen.tsx
View file @
c2bfaff4
...
@@ -41,10 +41,12 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
...
@@ -41,10 +41,12 @@ const RegisterScreen = ({ navigation }: RootTabScreenProps<"TabOne">) => {
validateEmpty
(
password
)
&&
validateEmpty
(
password
)
&&
validateEmpty
(
picked
)
validateEmpty
(
picked
)
)
{
)
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
, @typescript-eslint/no-unsafe-member-access
dispatch
(
dispatch
(
signupUser
(
firstName
,
lastName
,
email
,
password
,
phoneNo
,
picked
)
signupUser
(
firstName
,
lastName
,
email
,
password
,
phoneNo
,
picked
)
).
then
(()
=>
Alert
.
alert
(
"
Error
"
,
"
Something went wrong
"
));
)
.
then
(()
=>
null
)
.
catch
(()
=>
Alert
.
alert
(
"
Error
"
,
"
Something went wrong
"
));
// .then((e: ActionErrorRes) => e.error && Alert.alert("Error", e.error));
// .then((e: ActionErrorRes) => e.error && Alert.alert("Error", e.error));
}
else
{
}
else
{
Alert
.
alert
(
"
Form Tidak Lengkap
"
,
"
Silahkan isi form dengan benar
"
);
Alert
.
alert
(
"
Form Tidak Lengkap
"
,
"
Silahkan isi form dengan benar
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment