diff --git a/src/components/structures/HomePage.tsx b/src/components/structures/HomePage.tsx index 6facd941030e..e84d115e43d7 100644 --- a/src/components/structures/HomePage.tsx +++ b/src/components/structures/HomePage.tsx @@ -74,11 +74,9 @@ const UserWelcomeTop = () => { hasAvatar={!!ownProfile.avatarUrl} hasAvatarLabel={_tDom("Great, that'll help people know it's you")} noAvatarLabel={_tDom("Add a photo so people know it's you.")} - setAvatarUrl={async url => { - PosthogTrackers.trackInteraction("WebHomeMiniAvatarUploadButton"); - await cli.setAvatarUrl(url); - }} + setAvatarUrl={url => cli.setAvatarUrl(url)} isUserAvatar + onClick={ev => PosthogTrackers.trackInteraction("WebHomeMiniAvatarUploadButton", ev)} > ; isUserAvatar?: boolean; + onClick?(ev: MouseEvent): void; } const MiniAvatarUploader: React.FC = ({ - hasAvatar, hasAvatarLabel, noAvatarLabel, setAvatarUrl, isUserAvatar, children, + hasAvatar, hasAvatarLabel, noAvatarLabel, setAvatarUrl, isUserAvatar, children, onClick, }) => { const cli = useContext(MatrixClientContext); const [busy, setBusy] = useState(false); @@ -66,7 +67,10 @@ const MiniAvatarUploader: React.FC = ({ type="file" ref={uploadRef} className="mx_MiniAvatarUploader_input" - onClick={chromeFileInputFix} + onClick={(ev) => { + chromeFileInputFix(ev); + onClick?.(ev); + }} onChange={async (ev) => { if (!ev.target.files?.length) return; setBusy(true);