mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
Revert "Add loading status to vertical cells"
This reverts commit c6cff4dee4
.
This commit is contained in:
parent
5ee869c02c
commit
56c2e552f7
@ -15,14 +15,15 @@ struct ChannelPlaylistView: View {
|
|||||||
var player = PlayerModel.shared
|
var player = PlayerModel.shared
|
||||||
@ObservedObject private var recents = RecentsModel.shared
|
@ObservedObject private var recents = RecentsModel.shared
|
||||||
|
|
||||||
@State private var isLoading = false
|
|
||||||
|
|
||||||
private var items: [ContentItem] {
|
private var items: [ContentItem] {
|
||||||
ContentItem.array(of: store.item?.videos ?? [])
|
ContentItem.array(of: store.item?.videos ?? [])
|
||||||
}
|
}
|
||||||
|
|
||||||
private var resource: Resource? {
|
private var resource: Resource? {
|
||||||
accounts.api.channelPlaylist(playlist.id)
|
let resource = accounts.api.channelPlaylist(playlist.id)
|
||||||
|
resource?.addObserver(store)
|
||||||
|
|
||||||
|
return resource
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@ -47,7 +48,7 @@ struct ChannelPlaylistView: View {
|
|||||||
.labelStyle(.iconOnly)
|
.labelStyle(.iconOnly)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
VerticalCells(items: items, isLoading: isLoading)
|
VerticalCells(items: items)
|
||||||
.environment(\.inChannelPlaylistView, true)
|
.environment(\.inChannelPlaylistView, true)
|
||||||
}
|
}
|
||||||
.environment(\.listingStyle, channelPlaylistListingStyle)
|
.environment(\.listingStyle, channelPlaylistListingStyle)
|
||||||
@ -55,16 +56,11 @@ struct ChannelPlaylistView: View {
|
|||||||
if let cache = ChannelPlaylistsCacheModel.shared.retrievePlaylist(playlist) {
|
if let cache = ChannelPlaylistsCacheModel.shared.retrievePlaylist(playlist) {
|
||||||
store.replace(cache)
|
store.replace(cache)
|
||||||
}
|
}
|
||||||
isLoading = true
|
resource?.loadIfNeeded()?.onSuccess { response in
|
||||||
resource?
|
|
||||||
.load()
|
|
||||||
.onSuccess { response in
|
|
||||||
if let playlist: ChannelPlaylist = response.typedContent() {
|
if let playlist: ChannelPlaylist = response.typedContent() {
|
||||||
ChannelPlaylistsCacheModel.shared.storePlaylist(playlist: playlist)
|
ChannelPlaylistsCacheModel.shared.storePlaylist(playlist: playlist)
|
||||||
store.replace(playlist)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onCompletion { _ in isLoading = false }
|
|
||||||
}
|
}
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
.background(Color.background(scheme: colorScheme))
|
.background(Color.background(scheme: colorScheme))
|
||||||
|
@ -65,7 +65,7 @@ struct ChannelVideosView: View {
|
|||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VerticalCells(items: contentItems, isLoading: resource?.isLoading ?? false, edgesIgnoringSafeArea: verticalCellsEdgesIgnoringSafeArea) {
|
VerticalCells(items: contentItems, edgesIgnoringSafeArea: verticalCellsEdgesIgnoringSafeArea) {
|
||||||
if let description = presentedChannel?.description, !description.isEmpty {
|
if let description = presentedChannel?.description, !description.isEmpty {
|
||||||
Button {
|
Button {
|
||||||
withAnimation(.spring()) {
|
withAnimation(.spring()) {
|
||||||
|
@ -42,8 +42,20 @@ struct FavoriteItemView: View {
|
|||||||
.padding(.leading, 15)
|
.padding(.leading, 15)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if limitedItems.isEmpty {
|
if limitedItems.isEmpty, !(resource?.isLoading ?? false) {
|
||||||
EmptyItems(isLoading: resource?.isLoading ?? false) { reloadVisibleWatches() }
|
VStack(alignment: .leading) {
|
||||||
|
Text(emptyItemsText)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
|
||||||
|
if hideShorts || hideWatched {
|
||||||
|
AccentButton(text: "Disable filters", maxWidth: nil, verticalPadding: 0, minHeight: 30) {
|
||||||
|
hideShorts = false
|
||||||
|
hideWatched = false
|
||||||
|
reloadVisibleWatches()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.padding(.vertical, 10)
|
.padding(.vertical, 10)
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
.padding(.horizontal, 40)
|
.padding(.horizontal, 40)
|
||||||
@ -101,6 +113,19 @@ struct FavoriteItemView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var emptyItemsText: String {
|
||||||
|
var filterText = ""
|
||||||
|
if hideShorts && hideWatched {
|
||||||
|
filterText = "(watched and shorts hidden)"
|
||||||
|
} else if hideShorts {
|
||||||
|
filterText = "(shorts hidden)"
|
||||||
|
} else if hideWatched {
|
||||||
|
filterText = "(watched hidden)"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "No videos to show".localized() + " " + filterText.localized()
|
||||||
|
}
|
||||||
|
|
||||||
var contextMenu: some View {
|
var contextMenu: some View {
|
||||||
Group {
|
Group {
|
||||||
if item.section == .history {
|
if item.section == .history {
|
||||||
|
@ -70,7 +70,7 @@ struct PlaylistVideosView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VerticalCells(items: contentItems, isLoading: resource?.isLoading ?? false)
|
VerticalCells(items: contentItems)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
guard contentItems.isEmpty else { return }
|
guard contentItems.isEmpty else { return }
|
||||||
loadResource()
|
loadResource()
|
||||||
|
@ -63,11 +63,13 @@ struct PlaylistsView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
SignInRequiredView(title: "Playlists".localized()) {
|
SignInRequiredView(title: "Playlists".localized()) {
|
||||||
VStack {
|
VStack {
|
||||||
VerticalCells(items: items, isLoading: resource?.isLoading ?? false) { if shouldDisplayHeader { header } }
|
VerticalCells(items: items, allowEmpty: true) { if shouldDisplayHeader { header } }
|
||||||
.environment(\.currentPlaylistID, currentPlaylist?.id)
|
.environment(\.currentPlaylistID, currentPlaylist?.id)
|
||||||
.environment(\.listingStyle, playlistListingStyle)
|
.environment(\.listingStyle, playlistListingStyle)
|
||||||
|
|
||||||
if model.all.isEmpty {
|
if currentPlaylist != nil, items.isEmpty {
|
||||||
|
hintText("Playlist is empty\n\nTap and hold on a video and then \n\"Add to Playlist\"".localized())
|
||||||
|
} else if model.all.isEmpty {
|
||||||
hintText("You have no playlists\n\nTap on \"New Playlist\" to create one".localized())
|
hintText("You have no playlists\n\nTap on \"New Playlist\" to create one".localized())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,12 +244,22 @@ struct SearchView: View {
|
|||||||
if showRecentQueries {
|
if showRecentQueries {
|
||||||
recentQueries
|
recentQueries
|
||||||
} else {
|
} else {
|
||||||
VerticalCells(items: state.store.collection, isLoading: state.isLoading) {
|
VerticalCells(items: state.store.collection, allowEmpty: state.query.isEmpty) {
|
||||||
if shouldDisplayHeader {
|
if shouldDisplayHeader {
|
||||||
header
|
header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.environment(\.loadMoreContentHandler) { state.loadNextPage() }
|
.environment(\.loadMoreContentHandler) { state.loadNextPage() }
|
||||||
|
|
||||||
|
if noResults {
|
||||||
|
Text("No results")
|
||||||
|
|
||||||
|
if searchFiltersActive {
|
||||||
|
Button("Reset search filters", action: resetFilters)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,6 +280,12 @@ struct SearchView: View {
|
|||||||
searchDuration != .any || searchDate != .any
|
searchDuration != .any || searchDate != .any
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func resetFilters() {
|
||||||
|
searchSortOrder = .relevance
|
||||||
|
searchDate = .any
|
||||||
|
searchDuration = .any
|
||||||
|
}
|
||||||
|
|
||||||
private var noResults: Bool {
|
private var noResults: Bool {
|
||||||
state.store.collection.isEmpty && !state.isLoading && !state.query.isEmpty
|
state.store.collection.isEmpty && !state.isLoading && !state.query.isEmpty
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ struct FeedView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VerticalCells(items: videos, isLoading: feed.isLoading) { if shouldDisplayHeader { header } }
|
VerticalCells(items: videos) { if shouldDisplayHeader { header } }
|
||||||
.environment(\.loadMoreContentHandler) { feed.loadNextPage() }
|
.environment(\.loadMoreContentHandler) { feed.loadNextPage() }
|
||||||
.onAppear {
|
.onAppear {
|
||||||
feed.loadResources()
|
feed.loadResources()
|
||||||
|
@ -22,16 +22,26 @@ struct TrendingView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@State private var error: RequestError?
|
@State private var error: RequestError?
|
||||||
@State private var resource: Resource?
|
|
||||||
@State private var isLoading = false
|
|
||||||
|
|
||||||
init(_ videos: [Video] = [Video]()) {
|
init(_ videos: [Video] = [Video]()) {
|
||||||
self.videos = videos
|
self.videos = videos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var resource: Resource {
|
||||||
|
let newResource: Resource
|
||||||
|
|
||||||
|
newResource = accounts.api.trending(country: country, category: category)
|
||||||
|
newResource.addObserver(store)
|
||||||
|
|
||||||
|
return newResource
|
||||||
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VerticalCells(items: trending, isLoading: isLoading) { if shouldDisplayHeader { header } }
|
Section {
|
||||||
|
VerticalCells(items: trending) { if shouldDisplayHeader { header } }
|
||||||
.environment(\.listingStyle, trendingListingStyle)
|
.environment(\.listingStyle, trendingListingStyle)
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem {
|
ToolbarItem {
|
||||||
RequestErrorButton(error: error)
|
RequestErrorButton(error: error)
|
||||||
@ -48,17 +58,18 @@ struct TrendingView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
.onChange(of: category) { _ in updateResource() }
|
|
||||||
.onChange(of: country) { _ in updateResource() }
|
|
||||||
.onChange(of: accounts.current) { _ in updateResource() }
|
|
||||||
.onChange(of: resource) { _ in
|
.onChange(of: resource) { _ in
|
||||||
isLoading = true
|
resource.load()
|
||||||
resource?.load()
|
|
||||||
.onFailure { self.error = $0 }
|
.onFailure { self.error = $0 }
|
||||||
.onSuccess { _ in self.error = nil }
|
.onSuccess { _ in self.error = nil }
|
||||||
.onCompletion { _ in self.isLoading = false }
|
updateFavoriteItem()
|
||||||
}
|
}
|
||||||
.onAppear { updateResource()
|
.onAppear {
|
||||||
|
resource.loadIfNeeded()?
|
||||||
|
.onFailure { self.error = $0 }
|
||||||
|
.onSuccess { _ in self.error = nil }
|
||||||
|
|
||||||
|
updateFavoriteItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
@ -74,11 +85,9 @@ struct TrendingView: View {
|
|||||||
}
|
}
|
||||||
.background(
|
.background(
|
||||||
Button("Refresh") {
|
Button("Refresh") {
|
||||||
isLoading = true
|
resource.load()
|
||||||
resource?.load()
|
|
||||||
.onFailure { self.error = $0 }
|
.onFailure { self.error = $0 }
|
||||||
.onSuccess { _ in self.error = nil }
|
.onSuccess { _ in self.error = nil }
|
||||||
.onCompletion { _ in self.isLoading = false }
|
|
||||||
}
|
}
|
||||||
.keyboardShortcut("r")
|
.keyboardShortcut("r")
|
||||||
.opacity(0)
|
.opacity(0)
|
||||||
@ -87,18 +96,16 @@ struct TrendingView: View {
|
|||||||
#endif
|
#endif
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.refreshControl { refreshControl in
|
.refreshControl { refreshControl in
|
||||||
resource?.load().onCompletion { _ in
|
resource.load().onCompletion { _ in
|
||||||
refreshControl.endRefreshing()
|
refreshControl.endRefreshing()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.backport
|
.backport
|
||||||
.refreshable {
|
.refreshable {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
isLoading = true
|
resource.load()
|
||||||
resource?.load()
|
|
||||||
.onFailure { self.error = $0 }
|
.onFailure { self.error = $0 }
|
||||||
.onSuccess { _ in self.error = nil }
|
.onSuccess { _ in self.error = nil }
|
||||||
.onCompletion { _ in self.isLoading = false }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
@ -124,13 +131,9 @@ struct TrendingView: View {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
||||||
let request = resource?.loadIfNeeded()
|
resource.loadIfNeeded()?
|
||||||
if request != nil {
|
.onFailure { self.error = $0 }
|
||||||
isLoading = true
|
|
||||||
}
|
|
||||||
request?.onFailure { self.error = $0 }
|
|
||||||
.onSuccess { _ in self.error = nil }
|
.onSuccess { _ in self.error = nil }
|
||||||
.onCompletion { _ in self.isLoading = false }
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -222,7 +225,7 @@ struct TrendingView: View {
|
|||||||
private var countryButton: some View {
|
private var countryButton: some View {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
presentingCountrySelection.toggle()
|
presentingCountrySelection.toggle()
|
||||||
resource?.removeObservers(ownedBy: store)
|
resource.removeObservers(ownedBy: store)
|
||||||
}) {
|
}) {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
Label("Country", systemImage: "flag")
|
Label("Country", systemImage: "flag")
|
||||||
@ -233,13 +236,6 @@ struct TrendingView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updateResource() {
|
|
||||||
let resource = accounts.api.trending(country: country, category: category)
|
|
||||||
resource.addObserver(store)
|
|
||||||
self.resource = resource
|
|
||||||
updateFavoriteItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
private func updateFavoriteItem() {
|
private func updateFavoriteItem() {
|
||||||
favoriteItem = FavoriteItem(section: .trending(country.rawValue, category.rawValue))
|
favoriteItem = FavoriteItem(section: .trending(country.rawValue, category.rawValue))
|
||||||
}
|
}
|
||||||
@ -258,7 +254,7 @@ struct TrendingView: View {
|
|||||||
HideShortsButtons()
|
HideShortsButtons()
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
resource?.load()
|
resource.load()
|
||||||
.onFailure { self.error = $0 }
|
.onFailure { self.error = $0 }
|
||||||
.onSuccess { _ in self.error = nil }
|
.onSuccess { _ in self.error = nil }
|
||||||
} label: {
|
} label: {
|
||||||
|
@ -10,7 +10,7 @@ struct VerticalCells<Header: View>: View {
|
|||||||
@Environment(\.listingStyle) private var listingStyle
|
@Environment(\.listingStyle) private var listingStyle
|
||||||
|
|
||||||
var items = [ContentItem]()
|
var items = [ContentItem]()
|
||||||
var isLoading: Bool
|
var allowEmpty = false
|
||||||
var edgesIgnoringSafeArea = Edge.Set.horizontal
|
var edgesIgnoringSafeArea = Edge.Set.horizontal
|
||||||
|
|
||||||
let header: Header?
|
let header: Header?
|
||||||
@ -19,26 +19,25 @@ struct VerticalCells<Header: View>: View {
|
|||||||
|
|
||||||
init(
|
init(
|
||||||
items: [ContentItem],
|
items: [ContentItem],
|
||||||
isLoading: Bool,
|
allowEmpty: Bool = false,
|
||||||
edgesIgnoringSafeArea: Edge.Set = .horizontal,
|
edgesIgnoringSafeArea: Edge.Set = .horizontal,
|
||||||
@ViewBuilder header: @escaping () -> Header? = { nil }
|
@ViewBuilder header: @escaping () -> Header? = { nil }
|
||||||
) {
|
) {
|
||||||
self.items = items
|
self.items = items
|
||||||
self.isLoading = isLoading
|
self.allowEmpty = allowEmpty
|
||||||
self.edgesIgnoringSafeArea = edgesIgnoringSafeArea
|
self.edgesIgnoringSafeArea = edgesIgnoringSafeArea
|
||||||
self.header = header()
|
self.header = header()
|
||||||
}
|
}
|
||||||
|
|
||||||
init(
|
init(
|
||||||
items: [ContentItem],
|
items: [ContentItem],
|
||||||
isLoading: Bool
|
allowEmpty: Bool = false
|
||||||
) where Header == EmptyView {
|
) where Header == EmptyView {
|
||||||
self.init(items: items, isLoading: isLoading) { EmptyView() }
|
self.init(items: items, allowEmpty: allowEmpty) { EmptyView() }
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: scrollViewShowsIndicators) {
|
ScrollView(.vertical, showsIndicators: scrollViewShowsIndicators) {
|
||||||
Group {
|
|
||||||
LazyVGrid(columns: adaptiveItem, alignment: .center) {
|
LazyVGrid(columns: adaptiveItem, alignment: .center) {
|
||||||
Section(header: header) {
|
Section(header: header) {
|
||||||
ForEach(contentItems) { item in
|
ForEach(contentItems) { item in
|
||||||
@ -47,21 +46,6 @@ struct VerticalCells<Header: View>: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.overlay(
|
|
||||||
GeometryReader { proxy in
|
|
||||||
Color.clear
|
|
||||||
.onAppear {
|
|
||||||
gridSize = proxy.size
|
|
||||||
}
|
|
||||||
.onChange(of: proxy.size) { newValue in
|
|
||||||
gridSize = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if !isLoading && gridSize.height < 50 {
|
|
||||||
EmptyItems()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
.animation(nil)
|
.animation(nil)
|
||||||
@ -73,7 +57,7 @@ struct VerticalCells<Header: View>: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var contentItems: [ContentItem] {
|
var contentItems: [ContentItem] {
|
||||||
items.isEmpty && isLoading ? (ContentItem.placeholders) : items.sorted { $0 < $1 }
|
items.isEmpty ? (allowEmpty ? items : ContentItem.placeholders) : items.sorted { $0 < $1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadMoreContentItemsIfNeeded(current item: ContentItem) {
|
func loadMoreContentItemsIfNeeded(current item: ContentItem) {
|
||||||
@ -120,7 +104,7 @@ struct VerticalCells<Header: View>: View {
|
|||||||
|
|
||||||
struct VeticalCells_Previews: PreviewProvider {
|
struct VeticalCells_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VerticalCells(items: ContentItem.array(of: Array(repeating: Video.fixture, count: 30)), isLoading: false)
|
VerticalCells(items: ContentItem.array(of: Array(repeating: Video.fixture, count: 30)))
|
||||||
.injectFixtureEnvironmentObjects()
|
.injectFixtureEnvironmentObjects()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
import Defaults
|
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct EmptyItems: View {
|
|
||||||
@Default(.hideShorts) private var hideShorts
|
|
||||||
@Default(.hideWatched) private var hideWatched
|
|
||||||
|
|
||||||
var isLoading = false
|
|
||||||
var onDisableFilters: () -> Void = {}
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
VStack(alignment: .leading) {
|
|
||||||
Group {
|
|
||||||
if isLoading {
|
|
||||||
HStack(spacing: 10) {
|
|
||||||
ProgressView()
|
|
||||||
.progressViewStyle(.circular)
|
|
||||||
Text("Loading...")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Text(emptyItemsText)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
|
|
||||||
if hideShorts || hideWatched {
|
|
||||||
AccentButton(text: "Disable filters", maxWidth: nil, verticalPadding: 0, minHeight: 30) {
|
|
||||||
hideShorts = false
|
|
||||||
hideWatched = false
|
|
||||||
onDisableFilters()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var emptyItemsText: String {
|
|
||||||
var filterText = ""
|
|
||||||
if hideShorts && hideWatched {
|
|
||||||
filterText = "(watched and shorts hidden)"
|
|
||||||
} else if hideShorts {
|
|
||||||
filterText = "(shorts hidden)"
|
|
||||||
} else if hideWatched {
|
|
||||||
filterText = "(watched hidden)"
|
|
||||||
}
|
|
||||||
|
|
||||||
return "No videos to show".localized() + " " + filterText.localized()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct EmptyItems_Previews: PreviewProvider {
|
|
||||||
static var previews: some View {
|
|
||||||
VStack {
|
|
||||||
Spacer()
|
|
||||||
EmptyItems()
|
|
||||||
Spacer()
|
|
||||||
EmptyItems(isLoading: true)
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
.padding()
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,7 +20,7 @@ struct PopularView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VerticalCells(items: videos, isLoading: resource?.isLoading ?? false) { if shouldDisplayHeader { header } }
|
VerticalCells(items: videos) { if shouldDisplayHeader { header } }
|
||||||
.onAppear {
|
.onAppear {
|
||||||
resource?.addObserver(store)
|
resource?.addObserver(store)
|
||||||
resource?.loadIfNeeded()?
|
resource?.loadIfNeeded()?
|
||||||
|
@ -690,9 +690,6 @@
|
|||||||
379DC3D128BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
379DC3D128BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
||||||
379DC3D228BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
379DC3D228BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
||||||
379DC3D328BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
379DC3D328BA4EB400B09677 /* Seek.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379DC3D028BA4EB400B09677 /* Seek.swift */; };
|
||||||
379E7C2F2A20AF0A00AF8118 /* EmptyItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C2E2A20AF0A00AF8118 /* EmptyItems.swift */; };
|
|
||||||
379E7C302A20AF0A00AF8118 /* EmptyItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C2E2A20AF0A00AF8118 /* EmptyItems.swift */; };
|
|
||||||
379E7C312A20AF0A00AF8118 /* EmptyItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C2E2A20AF0A00AF8118 /* EmptyItems.swift */; };
|
|
||||||
379E7C332A20FE3900AF8118 /* FocusableSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */; };
|
379E7C332A20FE3900AF8118 /* FocusableSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */; };
|
||||||
379E7C342A20FE3900AF8118 /* FocusableSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */; };
|
379E7C342A20FE3900AF8118 /* FocusableSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */; };
|
||||||
379E7C362A2105B900AF8118 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 379E7C352A2105B900AF8118 /* Introspect */; };
|
379E7C362A2105B900AF8118 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 379E7C352A2105B900AF8118 /* Introspect */; };
|
||||||
@ -1397,7 +1394,6 @@
|
|||||||
379ACB502A1F8DB000E01914 /* HomeSettingsButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeSettingsButton.swift; sourceTree = "<group>"; };
|
379ACB502A1F8DB000E01914 /* HomeSettingsButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeSettingsButton.swift; sourceTree = "<group>"; };
|
||||||
379B0252287A1CDF001015B5 /* OrientationTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrientationTracker.swift; sourceTree = "<group>"; };
|
379B0252287A1CDF001015B5 /* OrientationTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrientationTracker.swift; sourceTree = "<group>"; };
|
||||||
379DC3D028BA4EB400B09677 /* Seek.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Seek.swift; sourceTree = "<group>"; };
|
379DC3D028BA4EB400B09677 /* Seek.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Seek.swift; sourceTree = "<group>"; };
|
||||||
379E7C2E2A20AF0A00AF8118 /* EmptyItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyItems.swift; sourceTree = "<group>"; };
|
|
||||||
379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusableSearchTextField.swift; sourceTree = "<group>"; };
|
379E7C322A20FE3900AF8118 /* FocusableSearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusableSearchTextField.swift; sourceTree = "<group>"; };
|
||||||
379EF9DF29AA585F009FE6C6 /* HideShortsButtons.swift */ = {isa = PBXFileReference; indentWidth = 3; lastKnownFileType = sourcecode.swift; path = HideShortsButtons.swift; sourceTree = "<group>"; };
|
379EF9DF29AA585F009FE6C6 /* HideShortsButtons.swift */ = {isa = PBXFileReference; indentWidth = 3; lastKnownFileType = sourcecode.swift; path = HideShortsButtons.swift; sourceTree = "<group>"; };
|
||||||
379F141E289ECE7F00DE48B5 /* QualitySettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QualitySettings.swift; sourceTree = "<group>"; };
|
379F141E289ECE7F00DE48B5 /* QualitySettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QualitySettings.swift; sourceTree = "<group>"; };
|
||||||
@ -1911,7 +1907,6 @@
|
|||||||
37FB285D272225E800A57617 /* ContentItemView.swift */,
|
37FB285D272225E800A57617 /* ContentItemView.swift */,
|
||||||
372CFD14285F2E2A00B0B54B /* ControlsBar.swift */,
|
372CFD14285F2E2A00B0B54B /* ControlsBar.swift */,
|
||||||
3748186D26A769D60084E870 /* DetailBadge.swift */,
|
3748186D26A769D60084E870 /* DetailBadge.swift */,
|
||||||
379E7C2E2A20AF0A00AF8118 /* EmptyItems.swift */,
|
|
||||||
37599F37272B4D740087F250 /* FavoriteButton.swift */,
|
37599F37272B4D740087F250 /* FavoriteButton.swift */,
|
||||||
379EF9DF29AA585F009FE6C6 /* HideShortsButtons.swift */,
|
379EF9DF29AA585F009FE6C6 /* HideShortsButtons.swift */,
|
||||||
37758C0A2A1D1C8B001FD900 /* HideWatchedButtons.swift */,
|
37758C0A2A1D1C8B001FD900 /* HideWatchedButtons.swift */,
|
||||||
@ -3190,7 +3185,6 @@
|
|||||||
374AB3DB28BCAF7E00DF56FB /* SeekType.swift in Sources */,
|
374AB3DB28BCAF7E00DF56FB /* SeekType.swift in Sources */,
|
||||||
37192D5728B179D60012EEDD /* ChaptersView.swift in Sources */,
|
37192D5728B179D60012EEDD /* ChaptersView.swift in Sources */,
|
||||||
37D836BC294927E700005E5E /* ChannelsCacheModel.swift in Sources */,
|
37D836BC294927E700005E5E /* ChannelsCacheModel.swift in Sources */,
|
||||||
379E7C2F2A20AF0A00AF8118 /* EmptyItems.swift in Sources */,
|
|
||||||
37B81AF926D2C9A700675966 /* VideoPlayerSizeModifier.swift in Sources */,
|
37B81AF926D2C9A700675966 /* VideoPlayerSizeModifier.swift in Sources */,
|
||||||
37C0698227260B2100F7F6CB /* ThumbnailsModel.swift in Sources */,
|
37C0698227260B2100F7F6CB /* ThumbnailsModel.swift in Sources */,
|
||||||
37BC50A82778A84700510953 /* HistorySettings.swift in Sources */,
|
37BC50A82778A84700510953 /* HistorySettings.swift in Sources */,
|
||||||
@ -3501,7 +3495,6 @@
|
|||||||
37599F35272B44000087F250 /* FavoritesModel.swift in Sources */,
|
37599F35272B44000087F250 /* FavoritesModel.swift in Sources */,
|
||||||
376527BC285F60F700102284 /* PlayerTimeModel.swift in Sources */,
|
376527BC285F60F700102284 /* PlayerTimeModel.swift in Sources */,
|
||||||
37F64FE526FE70A60081B69E /* RedrawOnModifier.swift in Sources */,
|
37F64FE526FE70A60081B69E /* RedrawOnModifier.swift in Sources */,
|
||||||
379E7C302A20AF0A00AF8118 /* EmptyItems.swift in Sources */,
|
|
||||||
377ABC45286E4B74009C986F /* ManifestedInstance.swift in Sources */,
|
377ABC45286E4B74009C986F /* ManifestedInstance.swift in Sources */,
|
||||||
3795593727B08538007FF8F4 /* StreamControl.swift in Sources */,
|
3795593727B08538007FF8F4 /* StreamControl.swift in Sources */,
|
||||||
37772E0E2A216F8600608BD9 /* String+ReplacingHTMLEntities.swift in Sources */,
|
37772E0E2A216F8600608BD9 /* String+ReplacingHTMLEntities.swift in Sources */,
|
||||||
@ -3796,7 +3789,6 @@
|
|||||||
37C3A24727235DA70087A57A /* ChannelPlaylist.swift in Sources */,
|
37C3A24727235DA70087A57A /* ChannelPlaylist.swift in Sources */,
|
||||||
3788AC2926F6840700F6BAA9 /* FavoriteItemView.swift in Sources */,
|
3788AC2926F6840700F6BAA9 /* FavoriteItemView.swift in Sources */,
|
||||||
37319F0727103F94004ECCD0 /* PlayerQueue.swift in Sources */,
|
37319F0727103F94004ECCD0 /* PlayerQueue.swift in Sources */,
|
||||||
379E7C312A20AF0A00AF8118 /* EmptyItems.swift in Sources */,
|
|
||||||
3718B9A52921A97F0003DB2E /* InspectorView.swift in Sources */,
|
3718B9A52921A97F0003DB2E /* InspectorView.swift in Sources */,
|
||||||
37E70925271CD43000D34DDE /* WelcomeScreen.swift in Sources */,
|
37E70925271CD43000D34DDE /* WelcomeScreen.swift in Sources */,
|
||||||
376BE50D27349108009AD608 /* BrowsingSettings.swift in Sources */,
|
376BE50D27349108009AD608 /* BrowsingSettings.swift in Sources */,
|
||||||
|
Loading…
Reference in New Issue
Block a user