Skip to content

Commit

Permalink
Corrigindo BUG de usuário sem o nome
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmorais committed Oct 20, 2024
1 parent 425afaa commit 0e2dcc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/screens/ProfileScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export default function ProfileScreen({ navigation }: Props) {

useEffect(() => {
if (userLogin) {
console.log("Chamando loadUser com userLogin ID:", userLogin.id);
loadUser(parseInt(userLogin.id));
setUserLogin(userLogin)
}
}, [userLogin]);
}, []);

const updateStorage = async () => {
const myUser = {
Expand Down Expand Up @@ -182,7 +182,7 @@ export default function ProfileScreen({ navigation }: Props) {
</View>

<ScrollView>
<ProfilePicture name={nomeUsuario || "User"} localImage={localImage} />
<ProfilePicture name={user?.nomeUsuario || userLogin?.nomeUsuario || "User"} localImage={localImage} />
<SettingsOption
label="Editar Perfil"
icon="user"
Expand Down

0 comments on commit 0e2dcc1

Please sign in to comment.