Skip to content

Commit

Permalink
Merge pull request #260 from MeeTeamNumdle/feature/#259_profile_image…
Browse files Browse the repository at this point in the history
…_bug

fix: 프로필 이미지 편집 이후, 편집 버튼 누르면 프로필 상세페이지로 리다이렉트 되는 이슈 해결
  • Loading branch information
kimsuyeon0916 authored Oct 24, 2024
2 parents 69a3b8d + 58778fb commit d7e7d92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/profile/edit/ProfileEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
ModalPortal,
Modal,
} from '../../../components';
import { useRecoilValue } from 'recoil';
import { useRecoilState, useRecoilValue } from 'recoil';
import { uploadImageState, userState } from '../../../atom';
import { Skill, Award, Link } from '../../../types';
import {
Expand Down Expand Up @@ -78,6 +78,7 @@ const ProfileEditPage = () => {

const updateProfileInSuccess = (userId: string) => {
navigate(`/profile/${userId}`);
setUploadImage(null); // 전역 업로드 이미지 초기화
};

const { mutate: updateProfile } = useUpdateProfile({
Expand All @@ -86,7 +87,7 @@ const ProfileEditPage = () => {
});

// 이미지 업로드
const uploadImage = useRecoilValue(uploadImageState);
const [uploadImage, setUploadImage] = useRecoilState(uploadImageState);
const {
data: imageResponse,
refetch: readImagePresignedUrl,
Expand Down

0 comments on commit d7e7d92

Please sign in to comment.