mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-13 13:01:03 +00:00
open rss item in in-app safari
This commit is contained in:
parent
6dc437b226
commit
b246e01f02
2 changed files with 6 additions and 6 deletions
|
@ -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/",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue