Skip to content

Commit

Permalink
[Edit] 프로필 사진 변경 로직 수정 #166
Browse files Browse the repository at this point in the history
프로필 사진 수정 시, 기존에 프로필 이미지가 nil 일 수 있음.
그런 경우에는 파베 user 내부의 프로필 이미지 주소에도 데이터를 저장해 줄 수 있도록 함.
  • Loading branch information
Phangg committed Mar 20, 2024
1 parent 27a91ff commit b26d6c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ struct UserProfileView: View {
do {
let uiImage = try await authViewModel.updateImage(selectedPhotos: selectedPhotos)
self.selectedImage = uiImage
await authViewModel.uploadProfileImageToStorage(image: uiImage)
let url = await authViewModel.uploadProfileImageToStorage(image: uiImage)
if authViewModel.currentUser?.userField.profileImageURL == nil {
await authViewModel.updateUserProfileImageURL(url: url)
}
} catch {
// 이미지 로드 실패 alert 띄워주기
showAlert = true
Expand Down

0 comments on commit b26d6c2

Please sign in to comment.