feat(chat): 유저 크리에이터 DM을 추가한다
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user