Skip to content

Commit

Permalink
feat: 프로필 기본 이미지
Browse files Browse the repository at this point in the history
  • Loading branch information
uiop5809 committed Sep 2, 2024
1 parent 5755ba2 commit 3e30370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/user/UserProfileUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const UserProfileUpdate = ({ onUpdate }: UserProfileUpdateProps) => {
const [mbti, setMbti] = useState<(string | null)[]>([null, null, null, null])
const [introduction, setIntroduction] = useState<string | null>(null)

/* 프로필 정보 초기화 */
useEffect(() => {
if (profile) {
setProfileImgUrl(profile.profileImgUrl || null)
Expand All @@ -41,6 +42,7 @@ const UserProfileUpdate = ({ onUpdate }: UserProfileUpdateProps) => {
}
}, [profile])

/* 프로필 정보 업데이트 */
useEffect(() => {
if (profile) {
const mbtiString = mbti.map((char) => char || '').join('')
Expand Down Expand Up @@ -111,7 +113,6 @@ const UserProfileUpdate = ({ onUpdate }: UserProfileUpdateProps) => {
if (profileImgUrl === profile?.profileImgUrl) {
deleteProfileImg(undefined, {
onSuccess: () => {
setProfileImgUrl(defaultImageUrl)
if (profileImgUrl === defaultImageUrl) {
showToast('기본 이미지는 삭제할 수 없습니다.')
}
Expand All @@ -125,7 +126,6 @@ const UserProfileUpdate = ({ onUpdate }: UserProfileUpdateProps) => {
else {
deleteProfileImgS3(profile?.profileImgUrl || '', {
onSuccess: () => {
setProfileImgUrl(defaultImageUrl)
if (profileImgUrl === defaultImageUrl) {
showToast('기본 이미지는 삭제할 수 없습니다.')
}
Expand Down

0 comments on commit 3e30370

Please sign in to comment.