Commit dffdcf3 1 parent 015e96d commit dffdcf3 Copy full SHA for dffdcf3
File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## Aviate Coders App
2
+
3
+ ---
4
+
5
+ Aviate coders is a platform where I write blogs and I thougt of making an android app for the same using React Native
Original file line number Diff line number Diff line change @@ -52,9 +52,16 @@ const LoginScreen = ({ navigation }: AuthNavProps<"LoginScreen">) => {
52
52
53
53
const login = async ( email : string , password : string ) => {
54
54
try {
55
- await auth ( ) . signInWithEmailAndPassword ( email , password ) ;
55
+ setLoading ( true ) ;
56
+ await auth ( )
57
+ . signInWithEmailAndPassword ( email , password )
58
+ . then ( ( ) => {
59
+ setLoading ( false ) ;
60
+ } ) ;
56
61
} catch ( e ) {
57
62
console . log ( e ) ;
63
+ setLoading ( false ) ;
64
+
58
65
Popup . show ( {
59
66
type : "warning" ,
60
67
title : "Email or password is wrong or you haven't signed in" ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ const SignupScreen = ({ navigation }: AuthNavProps<"SignupScreen">) => {
68
68
69
69
const register = async ( email : string , password : string ) => {
70
70
try {
71
+ setLoading ( true ) ;
71
72
await auth ( )
72
73
. createUserWithEmailAndPassword ( email , password )
73
74
. then ( ( ) => {
@@ -81,7 +82,11 @@ const SignupScreen = ({ navigation }: AuthNavProps<"SignupScreen">) => {
81
82
userImg : null ,
82
83
bookmarks : [ ] ,
83
84
} )
85
+ . then ( ( ) => {
86
+ setLoading ( false ) ;
87
+ } )
84
88
. catch ( ( error ) => {
89
+ setLoading ( false ) ;
85
90
Popup . show ( {
86
91
type : "warning" ,
87
92
title : "Error creating account" ,
You can’t perform that action at this time.
0 commit comments