feat: avatar upload for profile/chats, fix session persistence on refresh

- Profile modal: upload/remove user avatar, edit name/bio/phone, change password
- Chat info panel: upload/remove chat photo (owner/admin only)
- Avatar component: render photo when available, fallback to initials
- Session fix: initialize Zustand store from localStorage to prevent redirect on refresh
- Backend: avatar upload endpoints for users and chats, migration adds avatar columns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ai
2026-05-22 11:55:11 +03:00
parent 01331d0263
commit 3f54dbf375
9 changed files with 421 additions and 45 deletions

View File

@@ -3,6 +3,7 @@ export interface User {
username: string;
displayName: string;
avatarColor: string;
avatar?: string | null;
bio?: string;
phone?: string;
isAdmin: boolean;
@@ -15,6 +16,7 @@ export interface ChatMember {
username: string;
displayName: string;
avatarColor: string;
avatar?: string | null;
role: 'owner' | 'admin' | 'member';
online: boolean;
lastSeen: string;
@@ -27,6 +29,7 @@ export interface Chat {
title: string;
description?: string;
avatarColor: string;
avatar?: string | null;
isPublic?: boolean;
role: 'owner' | 'admin' | 'member';
lastMessage?: string;