diff --git a/Shared/Favorites/FavoritesView.swift b/Shared/Favorites/FavoritesView.swift index e247c418..14811d6d 100644 --- a/Shared/Favorites/FavoritesView.swift +++ b/Shared/Favorites/FavoritesView.swift @@ -49,6 +49,7 @@ struct FavoritesView: View { } .tieToLifetime(of: accounts) } + .redrawOn(change: favoritesChanged) #if os(tvOS) @@ -64,6 +65,11 @@ struct FavoritesView: View { #if os(iOS) .navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) #endif + #if !os(macOS) + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + favoritesChanged.toggle() + } + #endif } } } diff --git a/Shared/Playlists/PlaylistsView.swift b/Shared/Playlists/PlaylistsView.swift index f42fd3c9..0fe825eb 100644 --- a/Shared/Playlists/PlaylistsView.swift +++ b/Shared/Playlists/PlaylistsView.swift @@ -158,6 +158,12 @@ struct PlaylistsView: View { #if os(iOS) .navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) #endif + #if !os(macOS) + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + model.load() + resource?.loadIfNeeded() + } + #endif } #if os(tvOS) diff --git a/Shared/Trending/TrendingView.swift b/Shared/Trending/TrendingView.swift index 54bfcba7..459a21f0 100644 --- a/Shared/Trending/TrendingView.swift +++ b/Shared/Trending/TrendingView.swift @@ -140,6 +140,11 @@ struct TrendingView: View { } .navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) #endif + #if !os(macOS) + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + resource.loadIfNeeded() + } + #endif } #if os(tvOS) diff --git a/Shared/Views/PopularView.swift b/Shared/Views/PopularView.swift index 957515af..6fc73ffd 100644 --- a/Shared/Views/PopularView.swift +++ b/Shared/Views/PopularView.swift @@ -47,5 +47,10 @@ struct PopularView: View { } .navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) #endif + #if !os(macOS) + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + resource?.loadIfNeeded() + } + #endif } } diff --git a/Shared/Views/SubscriptionsView.swift b/Shared/Views/SubscriptionsView.swift index 17c88f43..8ba3ec12 100644 --- a/Shared/Views/SubscriptionsView.swift +++ b/Shared/Views/SubscriptionsView.swift @@ -50,6 +50,11 @@ struct SubscriptionsView: View { #if os(iOS) .navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) #endif + #if !os(macOS) + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + loadResources() + } + #endif } private func loadResources(force: Bool = false, onCompletion: @escaping () -> Void = {}) {