fix(banner): 이미지가 2장씩 넘어가는 버그 수정

This commit is contained in:
Yu Sung
2025-11-20 18:08:54 +09:00
parent 001f161fc5
commit 90b6dfb498
5 changed files with 5 additions and 51 deletions

View File

@@ -80,11 +80,10 @@ struct SeriesMainHomeBannerImageView: View {
let url: String
let width: CGFloat
let height: CGFloat
@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)
@@ -97,13 +96,6 @@ struct SeriesMainHomeBannerImageView: View {
}
}
.contentShape(Rectangle())
.onAppear {
let encoded = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? url
boundURL = URL(string: encoded)
}
.onDisappear {
boundURL = nil
}
}
}