diff --git a/client/src/Profile.tsx b/client/src/Profile.tsx index 56ff84d..25a56b4 100644 --- a/client/src/Profile.tsx +++ b/client/src/Profile.tsx @@ -19,11 +19,19 @@ export function Profile({ self }: IProfileProps) { return
Error
; } + const { posts } = loaderData; + + const user = self ? homeContext.user : loaderData.user; + + if (!user || isError(user)) { + return
Error
; + } + return (
- {homeContext.user.fullName} - {homeContext.user.fullName} + {user.fullName} + {user.username}
{self && (
@@ -38,10 +46,7 @@ export function Profile({ self }: IProfileProps) {
)} - +
); }