Skip to content

Commit f428dc1

Browse files
committed
ContextApi
1 parent 263e48c commit f428dc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Context/authContext.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const AuthProvider = ({children}) => {
3232
if(storageUser && storageToken){
3333
setUser(JSON.parse(storageUser));
3434
setLoading(false)
35-
}
35+
} setLoading(false)//para o caso a pessoa deslogue, o icone de carregar irá sumir
3636
}
3737
LoadStorageData();
3838
},[])
@@ -77,6 +77,7 @@ export const AuthProvider = ({children}) => {
7777
function signOut(){
7878
AsyncStorage.clear().then(()=>{
7979
setUser(null)
80+
setLoading(false)//para a tela de carregamento sumir logo após o logout
8081
})
8182
}
8283
/************* Deslogar *************/

0 commit comments

Comments
 (0)