콘텐츠 메인, 라이브 메인, 오디션 메인, 마이페이지
- 로그인 하지 않고 페이지 조회가 되도록 수정
This commit is contained in:
@@ -12,6 +12,7 @@ struct SectionEventBannerView: View {
|
||||
|
||||
@State private var currentIndex = 0
|
||||
@State private var timer = Timer.publish(every: 3, on: .main, in: .common).autoconnect()
|
||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||
|
||||
let items: [EventItem]
|
||||
|
||||
@@ -38,10 +39,14 @@ struct SectionEventBannerView: View {
|
||||
)
|
||||
.tag(index)
|
||||
.onTapGesture {
|
||||
if let _ = item.detailImageUrl {
|
||||
AppState.shared.setAppStep(step: .eventDetail(event: item))
|
||||
} else if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
if let _ = item.detailImageUrl {
|
||||
AppState.shared.setAppStep(step: .eventDetail(event: item))
|
||||
} else if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -62,10 +67,14 @@ struct SectionEventBannerView: View {
|
||||
)
|
||||
.tag(index)
|
||||
.onTapGesture {
|
||||
if let _ = item.detailImageUrl {
|
||||
AppState.shared.setAppStep(step: .eventDetail(event: item))
|
||||
} else if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
if let _ = item.detailImageUrl {
|
||||
AppState.shared.setAppStep(step: .eventDetail(event: item))
|
||||
} else if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user