From 86bbb281c80baeb5ae391590f965724bdc9da274 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Tue, 2 Jan 2024 18:44:26 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20-=20=EC=BB=A4?= =?UTF-8?q?=EB=B2=84=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20AS-IS=20:=20=EB=B0=A9?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EA=B0=80=EC=A0=B8=EC=98=AC=20?= =?UTF-8?q?=EB=95=8C=20=EB=A7=88=EB=8B=A4=20=EB=B3=80=EA=B2=BD=20TO-BE=20:?= =?UTF-8?q?=20=EC=9D=B4=EC=A0=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20url?= =?UTF-8?q?=EA=B3=BC=20=EB=8B=A4=EB=A5=B8=20=EA=B2=BD=EC=9A=B0=20=EC=97=90?= =?UTF-8?q?=EB=A7=8C=20=EC=BB=A4=EB=B2=84=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/Live/Room/LiveRoomView.swift | 4 ++-- SodaLive/Sources/Live/Room/LiveRoomViewModel.swift | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SodaLive/Sources/Live/Room/LiveRoomView.swift b/SodaLive/Sources/Live/Room/LiveRoomView.swift index c84319d..d832c1b 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomView.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomView.swift @@ -277,8 +277,8 @@ struct LiveRoomView: View { ScrollViewReader { proxy in ZStack(alignment: .bottomTrailing) { GeometryReader { proxy in - if let liveRoomInfo = viewModel.liveRoomInfo, viewModel.isBgOn { - KFImage(URL(string: liveRoomInfo.coverImageUrl)) + if let coverImageUrl = viewModel.coverImageUrl, viewModel.isBgOn { + KFImage(URL(string: coverImageUrl)) .resizable() .scaledToFill() .frame(width: proxy.size.width, height: proxy.size.height, alignment: .center) diff --git a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift index 677cc30..b8fca5e 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift @@ -36,6 +36,8 @@ final class LiveRoomViewModel: NSObject, ObservableObject { @Published var liveRoomInfo: GetRoomInfoResponse? @Published var userProfile: GetLiveRoomUserProfileResponse? + @Published var coverImageUrl: String? + @Published var isLoading = false @Published var errorMessage = "" @Published var reportMessage = "" @@ -256,6 +258,11 @@ final class LiveRoomViewModel: NSObject, ObservableObject { if let data = decoded.data, decoded.success { self.liveRoomInfo = data + + if self.coverImageUrl != data.coverImageUrl { + self.coverImageUrl = data.coverImageUrl + } + self.isActiveRoulette = data.isActiveRoulette self.isLoading = true self.agora.joinChannel(