open rss item in in-app safari

This commit is contained in:
Duong Thai 2024-03-07 10:33:07 +07:00
parent 6dc437b226
commit b246e01f02
2 changed files with 6 additions and 6 deletions

View file

@ -20,8 +20,8 @@ public struct RSSTab: View {
@Environment(\.managedObjectContext) private var moContext
@State private var isLoading = true
@Environment(RouterPath.self) private var routerPath
@State private var showAlert = false
@State private var routerPath = RouterPath()
public init() {}
@ -31,15 +31,15 @@ public struct RSSTab: View {
ProgressView()
} else {
List {
ForEach(items) { i in
ForEach(items) { item in
Button(action: {
if let url = i.url {
if let url = item.url {
_ = routerPath.handle(url: url)
} else {
showAlert = true
}
}, label: {
RSSItemView(i)
RSSItemView(item)
})
.buttonStyle(.plain)
.alert("rss.item.url.unavailable", isPresented: $showAlert) {
@ -61,8 +61,9 @@ public struct RSSTab: View {
let feedURLs = [
"https://www.swift.org/atom.xml",
"https://www.computerenhance.com/feed",
"https://wadetregaskis.com/feed",
"https://121clicks.com/feed",
// "https://121clicks.com/feed",
"https://iso.500px.com/feed/",
]

View file

@ -77,7 +77,6 @@ enum Tab: Int, Identifiable, Hashable, CaseIterable, Codable {
case .other:
EmptyView()
case .rss:
// FIXME: open in web view
RSSTab()
.withSafariRouter()
.environment(Self.routerPath)