라이브 룰렛
- 룰렛 설정 아이콘 추가 - 룰렛 돌리기 아이콘 추가
This commit is contained in:
@@ -24,6 +24,7 @@ struct GetRoomInfoResponse: Decodable {
|
||||
let listenerList: [LiveRoomMember]
|
||||
let managerList: [LiveRoomMember]
|
||||
let donationRankingTop3UserIds: [Int]
|
||||
let isActiveRoulette: Bool
|
||||
let isPrivateRoom: Bool
|
||||
let password: String?
|
||||
}
|
||||
|
@@ -307,6 +307,26 @@ struct LiveRoomView: View {
|
||||
}
|
||||
|
||||
VStack(spacing: 13.3) {
|
||||
if let liveRoomInfo = viewModel.liveRoomInfo {
|
||||
if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) {
|
||||
Image("ic_roulette_settings")
|
||||
.resizable()
|
||||
.frame(width: 26.7, height: 26.7)
|
||||
.padding(11)
|
||||
.background(Color(hex: "525252").opacity(0.6))
|
||||
.cornerRadius(10)
|
||||
.padding(.bottom, 13.3)
|
||||
} else if liveRoomInfo.creatorId != UserDefaults.int(forKey: .userId) && viewModel.isActiveRoulette {
|
||||
Image("ic_roulette")
|
||||
.resizable()
|
||||
.frame(width: 26.7, height: 26.7)
|
||||
.padding(11)
|
||||
.background(Color(hex: "525252").opacity(0.6))
|
||||
.cornerRadius(10)
|
||||
.padding(.bottom, 13.3)
|
||||
}
|
||||
}
|
||||
|
||||
if viewModel.role == .SPEAKER {
|
||||
Image(viewModel.isMute ? "ic_mic_off" : "ic_mic_on")
|
||||
.resizable()
|
||||
|
@@ -132,6 +132,8 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
@Published var isNoChatting = false
|
||||
@Published var remainingNoChattingTime = 0
|
||||
|
||||
@Published var isActiveRoulette = false
|
||||
|
||||
var timer: DispatchSourceTimer?
|
||||
|
||||
func setOriginOffset(_ offset: CGFloat) {
|
||||
@@ -243,6 +245,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
|
||||
if let data = decoded.data, decoded.success {
|
||||
self.liveRoomInfo = data
|
||||
self.isActiveRoulette = data.isActiveRoulette
|
||||
self.isLoading = true
|
||||
self.agora.joinChannel(
|
||||
roomInfo: data,
|
||||
|
Reference in New Issue
Block a user