fix(account-settings): clear stale pw error on input + live header avatar update
- Password form errors (wrong pw, mismatch) now clear on first keystroke
in any password field instead of persisting until next submit.
- Avatar upload now bumps avatarVersion in auth store and sets hasAvatar=true,
so the header avatar switches to the uploaded image immediately without reload.
- Header img src uses ?v={avatarVersion} as cache-buster to force browser to
fetch the new avatar when version increments.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ export function Header() {
|
||||
const t = useTranslations();
|
||||
const tHeader = useTranslations('header');
|
||||
const setMobileOpen = useSidebarStore((s) => s.setMobileOpen);
|
||||
const { user, setUser } = useAuthStore();
|
||||
const { user, setUser, avatarVersion } = useAuthStore();
|
||||
const [dropdownOpen, setDropdownOpen] = useState(false);
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
const pathname = usePathname();
|
||||
@@ -112,7 +112,7 @@ export function Header() {
|
||||
>
|
||||
{user?.hasAvatar && !avatarError ? (
|
||||
<img
|
||||
src="/api-proxy/users/me/avatar"
|
||||
src={`/api-proxy/users/me/avatar?v=${avatarVersion}`}
|
||||
alt=""
|
||||
className="h-8 w-8 rounded-full object-cover"
|
||||
onError={() => setAvatarError(true)}
|
||||
|
||||
Reference in New Issue
Block a user