feat(fantalk): 쓰기 입력 제한을 적용한다

This commit is contained in:
Yu Sung
2026-08-25 17:36:44 +09:00
parent 425099955b
commit cb3778a76f
5 changed files with 166 additions and 6 deletions

View File

@@ -29,7 +29,15 @@ final class CreatorChannelFanTalkWriteViewModel: ObservableObject {
let maxContentCount = 500
var isContentOverLimit: Bool {
content.count > maxContentCount
}
var canSend: Bool {
hasContent && isContentOverLimit == false
}
private var hasContent: Bool {
content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false
}
@@ -40,7 +48,7 @@ final class CreatorChannelFanTalkWriteViewModel: ObservableObject {
}
func handleCancel() -> Bool {
guard canSend else { return true }
guard hasContent else { return true }
shouldShowExitModal = true
return false