diff options
Diffstat (limited to 'Sora/Views/Post')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index 5c071b8..a5ff85a 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -240,6 +240,13 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length } } } + .onChange(of: navigationPath) { _, _ in + if initialTag == nil && !manager.isNavigatingHistory && !manager.isLoading { + Task(priority: .userInitiated) { + await manager.fetchPosts(page: 1, tags: manager.tags, replace: true) + } + } + } .onAppear { if let initialTag { if localSearchText.isEmpty || !hasAppearedBefore { @@ -270,6 +277,12 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length } } } + } else { + if !manager.isNavigatingHistory && !manager.isLoading { + Task(priority: .userInitiated) { + await manager.fetchPosts(page: 1, tags: manager.tags, replace: true) + } + } } } .toolbar { |