mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Less obnoxious error handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Defaults
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct SubscriptionsView: View {
|
||||
@@ -11,6 +12,7 @@ struct SubscriptionsView: View {
|
||||
@Default(.subscriptionsListingStyle) private var subscriptionsListingStyle
|
||||
|
||||
@ObservedObject private var feed = FeedModel.shared
|
||||
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
|
||||
|
||||
var body: some View {
|
||||
SignInRequiredView(title: "Subscriptions".localized()) {
|
||||
@@ -32,6 +34,10 @@ struct SubscriptionsView: View {
|
||||
ToolbarItem(placement: .principal) {
|
||||
subscriptionsMenu
|
||||
}
|
||||
|
||||
ToolbarItem {
|
||||
RequestErrorButton(error: requestError)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if os(macOS)
|
||||
@@ -51,6 +57,10 @@ struct SubscriptionsView: View {
|
||||
#endif
|
||||
}
|
||||
|
||||
var requestError: RequestError? {
|
||||
subscriptionsViewPage == .channels ? subscriptions.error : feed.error
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
var subscriptionsMenu: some View {
|
||||
Menu {
|
||||
|
Reference in New Issue
Block a user