diff --git a/backend/src/chat/chat.gateway.ts b/backend/src/chat/chat.gateway.ts index b9bd7610..721bd4a0 100644 --- a/backend/src/chat/chat.gateway.ts +++ b/backend/src/chat/chat.gateway.ts @@ -174,9 +174,8 @@ export class ChatGateway { @MessageBody() data: { deniedUserId: number }, @ConnectedSocket() client: Socket, ) { - const deniedUserWsId = this.chatService.getWsFromUserId( - data.deniedUserId, - )?.id; + const deniedUserWsId = this.chatService.getWsFromUserId(data.deniedUserId) + ?.id; if (!deniedUserWsId) { return; } else { diff --git a/frontend/app/ui/user/avatar.tsx b/frontend/app/ui/user/avatar.tsx index 0d6d83ee..8bd865f1 100644 --- a/frontend/app/ui/user/avatar.tsx +++ b/frontend/app/ui/user/avatar.tsx @@ -25,9 +25,6 @@ export function Avatar({ avatarURL, size, href, alt, id }: Props) { const onlineStatuses = useContext(OnlineContext); const online = id ? onlineStatuses[id] : false; let sizeClass = ""; - if (!avatarURL) { - return ; - } let onlineStatusClass = online ? "bg-green-500 " : "bg-gray-500 "; switch (size) { case "small": @@ -45,9 +42,17 @@ export function Avatar({ avatarURL, size, href, alt, id }: Props) { default: throw new Error("Invalid size"); } - if (!avatarURL) { - return ; - } + const icon = avatarURL ? ( + {alt} + ) : ( +
+ +
+ ); const TooltipWrapper = ({ children }: { children: React.ReactNode }) => alt !== undefined ? ( @@ -63,13 +68,7 @@ export function Avatar({ avatarURL, size, href, alt, id }: Props) {
- - {alt} - + {icon}