fix(banner): 이미지가 2장씩 넘어가는 버그 수정
This commit is contained in:
@@ -107,11 +107,10 @@ struct ContentMainBannerImageView: View {
|
||||
let width: CGFloat
|
||||
let height: CGFloat
|
||||
let item: GetAudioContentBannerResponse
|
||||
@State private var boundURL: URL?
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if let boundURL {
|
||||
if let boundURL = URL(string: url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? url) {
|
||||
DownsampledKFImage(
|
||||
url: boundURL,
|
||||
size: CGSize(width: width, height: height)
|
||||
@@ -138,12 +137,5 @@ struct ContentMainBannerImageView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
let encoded = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? url
|
||||
boundURL = URL(string: encoded)
|
||||
}
|
||||
.onDisappear {
|
||||
boundURL = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user