From 28b64ba8a8391fd668b5bcdee1768fbb9d3b0933 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 20 Dec 2023 00:39:29 +0900 Subject: [PATCH] =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EB=AC=BC=20-=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=EC=97=86=EC=96=B4=EB=8F=84=20=EB=93=B1=EB=A1=9D=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?-=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20-=20=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=B1=84=EB=84=90=20-=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EB=AC=BC=20=EB=86=92=EC=9D=B4=EA=B0=80=20=EA=B0=99=EC=9D=84=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=EA=B0=80=20=EC=97=86=EC=9C=BC=EB=A9=B4=20Rectangle=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreatorCommunity/CreatorCommunityItemView.swift | 4 ++++ .../Write/CreatorCommunityWriteViewModel.swift | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/SodaLive/Sources/Explorer/Profile/CreatorCommunity/CreatorCommunityItemView.swift b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/CreatorCommunityItemView.swift index f0de553..4ce9532 100644 --- a/SodaLive/Sources/Explorer/Profile/CreatorCommunity/CreatorCommunityItemView.swift +++ b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/CreatorCommunityItemView.swift @@ -45,6 +45,10 @@ struct CreatorCommunityItemView: View { .resizable() .frame(width: 53.3, height: 53.3) .cornerRadius(4.7) + } else { + Rectangle() + .foregroundColor(Color(hex: "222222").opacity(0)) + .frame(width: 53.3, height: 53.3) } } diff --git a/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteViewModel.swift b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteViewModel.swift index 9f74c42..9dc8347 100644 --- a/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteViewModel.swift +++ b/SodaLive/Sources/Explorer/Profile/CreatorCommunity/Write/CreatorCommunityWriteViewModel.swift @@ -45,11 +45,6 @@ final class CreatorCommunityWriteViewModel: ObservableObject { fileName: "\(UUID().uuidString)_\(Date().timeIntervalSince1970 * 1000).jpg", mimeType: "image/*") ) - } else { - errorMessage = "이미지를 업로드 하지 못했습니다.\n다시 선택해 주세요" - isShowPopup = true - isLoading = false - return } multipartData.append(MultipartFormData(provider: .data(jsonData), name: "request")) @@ -103,6 +98,12 @@ final class CreatorCommunityWriteViewModel: ObservableObject { } private func validateData() -> Bool { + if content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || content.count < 5 { + errorMessage = "내용을 5자 이상 입력해 주세요." + isShowPopup = true + return false + } + return true } }