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

View file

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