라이브 - 커버이미지 수정방식 변경
AS-IS : 방 정보를 가져올 때 마다 변경 TO-BE : 이전 이미지 url과 다른 경우 에만 커버이미지 변경
This commit is contained in:
parent
735796a970
commit
86bbb281c8
|
@ -277,8 +277,8 @@ struct LiveRoomView: View {
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
GeometryReader { proxy in
|
GeometryReader { proxy in
|
||||||
if let liveRoomInfo = viewModel.liveRoomInfo, viewModel.isBgOn {
|
if let coverImageUrl = viewModel.coverImageUrl, viewModel.isBgOn {
|
||||||
KFImage(URL(string: liveRoomInfo.coverImageUrl))
|
KFImage(URL(string: coverImageUrl))
|
||||||
.resizable()
|
.resizable()
|
||||||
.scaledToFill()
|
.scaledToFill()
|
||||||
.frame(width: proxy.size.width, height: proxy.size.height, alignment: .center)
|
.frame(width: proxy.size.width, height: proxy.size.height, alignment: .center)
|
||||||
|
|
|
@ -36,6 +36,8 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||||
@Published var liveRoomInfo: GetRoomInfoResponse?
|
@Published var liveRoomInfo: GetRoomInfoResponse?
|
||||||
@Published var userProfile: GetLiveRoomUserProfileResponse?
|
@Published var userProfile: GetLiveRoomUserProfileResponse?
|
||||||
|
|
||||||
|
@Published var coverImageUrl: String?
|
||||||
|
|
||||||
@Published var isLoading = false
|
@Published var isLoading = false
|
||||||
@Published var errorMessage = ""
|
@Published var errorMessage = ""
|
||||||
@Published var reportMessage = ""
|
@Published var reportMessage = ""
|
||||||
|
@ -256,6 +258,11 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||||
|
|
||||||
if let data = decoded.data, decoded.success {
|
if let data = decoded.data, decoded.success {
|
||||||
self.liveRoomInfo = data
|
self.liveRoomInfo = data
|
||||||
|
|
||||||
|
if self.coverImageUrl != data.coverImageUrl {
|
||||||
|
self.coverImageUrl = data.coverImageUrl
|
||||||
|
}
|
||||||
|
|
||||||
self.isActiveRoulette = data.isActiveRoulette
|
self.isActiveRoulette = data.isActiveRoulette
|
||||||
self.isLoading = true
|
self.isLoading = true
|
||||||
self.agora.joinChannel(
|
self.agora.joinChannel(
|
||||||
|
|
Loading…
Reference in New Issue