diff --git a/Yattee/Localizable.xcstrings b/Yattee/Localizable.xcstrings index 10b48f8e..bfc856c1 100644 --- a/Yattee/Localizable.xcstrings +++ b/Yattee/Localizable.xcstrings @@ -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" : { diff --git a/Yattee/Views/Channel/ChannelView.swift b/Yattee/Views/Channel/ChannelView.swift index a76f3d44..eba8b6a7 100644 --- a/Yattee/Views/Channel/ChannelView.swift +++ b/Yattee/Views/Channel/ChannelView.swift @@ -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")) } } }