룰렛 아이템 랜덤 선택 로직 수정

This commit is contained in:
Yu Sung 2023-12-12 01:26:30 +09:00
parent 0c116fb700
commit 6fecd27954
1 changed files with 1 additions and 1 deletions

View File

@ -1495,7 +1495,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
isLoading = false isLoading = false
self.rouletteItems.removeAll() self.rouletteItems.removeAll()
self.rouletteItems.append(contentsOf: items.map { $0.title }) self.rouletteItems.append(contentsOf: items.map { $0.title })
self.rouletteSelectedItem = rouletteItems[Int(arc4random_uniform(UInt32(rouletteItems.count)))] self.rouletteSelectedItem = rouletteItems.randomElement()!
self.rouletteCan = can self.rouletteCan = can
self.isShowRoulette = true self.isShowRoulette = true
} }