From b26d6c27366da5a09d3e80072cd12f3722601b30 Mon Sep 17 00:00:00 2001 From: Phangg Date: Wed, 20 Mar 2024 16:01:39 +0900 Subject: [PATCH] =?UTF-8?q?[Edit]=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=82=AC=EC=A7=84=20=EB=B3=80=EA=B2=BD=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20#166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 프로필 사진 수정 시, 기존에 프로필 이미지가 nil 일 수 있음. 그런 경우에는 파베 user 내부의 프로필 이미지 주소에도 데이터를 저장해 줄 수 있도록 함. --- JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift b/JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift index a1594767..c813e7e3 100644 --- a/JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift +++ b/JUDA_iOS/JUDA/View/Mypage/MypageDetail/UserProfileView.swift @@ -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