Skip to content

Commit 542d3a3

Browse files
committed
๐Ÿ› [fix] ํ”„๋กœํ•„ ์‚ฌ์ง„ s3์— ์‚ญ์ œ ์‹œ ์นด์นด์˜ค url์ธ ๊ฒฝ์šฐ ์ฒ˜๋ฆฌํ•˜์ง€ ์•Š๊ฒŒ ๊ฐœ์„ 
1 parent d18cc2a commit 542d3a3

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)