summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-09 03:25:05 -0700
committerFuwn <[email protected]>2025-09-09 03:25:05 -0700
commit046fe0e89ad457810c228363cbd63ebcf694f007 (patch)
tree142a6a4ddecbdd6056bc79d48ad7c6475b835664 /Sora
parentfeat: Development commit (diff)
downloadsora-testing-046fe0e89ad457810c228363cbd63ebcf694f007.tar.xz
sora-testing-046fe0e89ad457810c228363cbd63ebcf694f007.zip
feat: Development commit
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Views/Post/Grid/PostGridView.swift19
1 files changed, 17 insertions, 2 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift
index f90bdc2..62706c2 100644
--- a/Sora/Views/Post/Grid/PostGridView.swift
+++ b/Sora/Views/Post/Grid/PostGridView.swift
@@ -22,6 +22,7 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length
@State private var localSearchText = ""
@State private var localEndOfData = false
@State private var localError: Error?
+ @State private var hasAppearedBefore = false
init(
selectedTab: Binding<Int>, navigationPath: Binding<NavigationPath>, initialTag: String? = nil
@@ -242,8 +243,22 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length
if let initialTag {
localSearchText = initialTag
- Task(priority: .userInitiated) {
- await performLocalSearch()
+ if !hasAppearedBefore {
+ hasAppearedBefore = true
+
+ Task(priority: .userInitiated) {
+ await performLocalSearch()
+ }
+ } else {
+ Task(priority: .userInitiated) {
+ await fetchLocalPosts(
+ page: 1,
+ tags: localSearchText.components(separatedBy: .whitespaces).filter { component in
+ !component.isEmpty
+ },
+ replace: true
+ )
+ }
}
}
}