feat(chat): 유저 크리에이터 DM을 추가한다

This commit is contained in:
Yu Sung
2026-07-12 04:48:17 +09:00
parent ce191539f2
commit 2dfff32ac1
23 changed files with 2410 additions and 6 deletions

View File

@@ -234,7 +234,11 @@ struct CreatorChannelView: View {
@ViewBuilder
private var headerSection: some View {
if let creator = viewModel.response?.creator {
CreatorChannelHeaderSection(creator: creator, onTapTalk: handleTalkTap)
CreatorChannelHeaderSection(
creator: creator,
onTapTalk: handleTalkTap,
onTapDm: handleDmTap
)
}
}
@@ -544,6 +548,18 @@ struct CreatorChannelView: View {
startChat(characterId: characterId)
}
private func handleDmTap() {
guard let creatorId = viewModel.response?.creator.creatorId, creatorId > 0 else { return }
let trimmed = token.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else {
AppState.shared.setAppStep(step: .login)
return
}
AppState.shared.setAppStep(step: .userCreatorChatCreator(creatorId: creatorId))
}
private func startChat(characterId: Int) {
viewModel.createChatRoom(characterId: characterId) { chatRoomId in
AppState.shared.setAppStep(step: .chatRoom(id: chatRoomId))