mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Offer a delayed Cancel while a tvOS channel loads, and fill the blank state
Without a cached header the channel showed only a spinner, and when the channel request failed while the videos request succeeded (no cache to build the channel from) it rendered nothing at all; both left the tvOS remote with nothing to focus. Cancel stops at the error view and its Retry, since a sidebar channel is a tab root that cannot be popped; the blank state now shows the load error with Retry on every platform.
This commit is contained in:
@@ -1745,6 +1745,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"common.loadingStopped" : {
|
||||
"comment" : "Shown in place of content after the user cancels a slow load on tvOS",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Loading was stopped."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"common.loadMore" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
|
||||
@@ -189,9 +189,21 @@ struct ChannelView: View {
|
||||
loadingContent(cachedHeader)
|
||||
} else if isLoading {
|
||||
ProgressView()
|
||||
#if os(tvOS)
|
||||
// As a sidebar channel this is a tab root that cannot
|
||||
// be popped, so Cancel lands on the error and its Retry.
|
||||
.tvStalledLoadCancel {
|
||||
isLoading = false
|
||||
errorMessage = String(localized: "common.loadingStopped")
|
||||
}
|
||||
#endif
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else if let error = errorMessage {
|
||||
errorView(error)
|
||||
} else {
|
||||
// The channel request failed while the videos one did not,
|
||||
// with no cached header to build the channel from.
|
||||
errorView(String(localized: "channelView.loadError"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user