fix(banner): 이미지가 2장씩 넘어가는 버그 수정
This commit is contained in:
@@ -77,11 +77,10 @@ private struct SectionEventBannerPage: View {
|
||||
let width: CGFloat
|
||||
let height: CGFloat
|
||||
let token: String
|
||||
@State private var boundURL: URL?
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if let boundURL {
|
||||
if let boundURL = URL(string: item.thumbnailImageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? item.thumbnailImageUrl) {
|
||||
KFImage(boundURL)
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: width, height: height))
|
||||
@@ -108,14 +107,5 @@ private struct SectionEventBannerPage: View {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
let urlString = item.thumbnailImageUrl.addingPercentEncoding(
|
||||
withAllowedCharacters: .urlQueryAllowed
|
||||
) ?? item.thumbnailImageUrl
|
||||
boundURL = URL(string: urlString)
|
||||
}
|
||||
.onDisappear {
|
||||
boundURL = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user