diff options
| author | Fuwn <[email protected]> | 2025-09-11 22:59:04 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-11 22:59:04 -0700 |
| commit | 1af757409c5cf47b6c515d64c0656759129cd950 (patch) | |
| tree | 7e8aab9df226f93cb339da0bd985fd934053e596 /Sora/Views/Post/Grid/PostGridView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-1af757409c5cf47b6c515d64c0656759129cd950.tar.xz sora-testing-1af757409c5cf47b6c515d64c0656759129cd950.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Grid/PostGridView.swift')
| -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 { |