Skip to content

Commit 6d26a07

Browse files
committed
Merge branch 'develop' of https://github.com/YAPP-Github/21st-iOS-Team-2-iOS into feature/report-block
2 parents 746f31e + 542d3a3 commit 6d26a07

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Fitfty/Projects/Setting/Sources/Profile/ViewModel/ProfileSettingViewModel.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ public final class ProfileSettingViewModel: ViewModelType {
3535
Task {
3636
do {
3737
var url: String?
38-
if let imageData = currentImage.value,
39-
let filename = filenameFromFilepath(profilePictureUrl.value) {
38+
if let imageData = currentImage.value {
4039
let userToken = try await repository.getUserPrivacy().data?.userToken ?? UUID().uuidString
4140
url = try await AmplifyManager.shared.uploadImage(data: imageData, fileName: "profile/\(userToken)_\(Date().currentfullDate)").absoluteString
42-
try await AmplifyManager.shared.delete(fileName: filename)
41+
if let filename = filenameFromFilepath(profilePictureUrl.value) {
42+
try await AmplifyManager.shared.delete(fileName: filename)
43+
}
4344
}
4445
saveUserProfile(imageUrl: url, message: message)
4546
} catch {

0 commit comments

Comments
 (0)