diff options
| author | Fuwn <[email protected]> | 2025-09-05 19:48:59 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-05 19:48:59 -0700 |
| commit | d5b81fcbc1a8c009204b2482d490e8d8b96c6c26 (patch) | |
| tree | 3cf3593d4aa9facf028d4fe40d952f848f5b2b3f /Sora/Views/Post/Details | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-d5b81fcbc1a8c009204b2482d490e8d8b96c6c26.tar.xz sora-testing-d5b81fcbc1a8c009204b2482d490e8d8b96c6c26.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Details')
| -rw-r--r-- | Sora/Views/Post/Details/PostDetailsView.swift | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Sora/Views/Post/Details/PostDetailsView.swift b/Sora/Views/Post/Details/PostDetailsView.swift index 4a7daf3..bca956a 100644 --- a/Sora/Views/Post/Details/PostDetailsView.swift +++ b/Sora/Views/Post/Details/PostDetailsView.swift @@ -14,13 +14,13 @@ struct PostDetailsView: View { private var imageURL: URL? { switch settings.detailViewQuality { case .preview: - post.previewURL + currentPost.previewURL case .sample: - post.sampleURL + currentPost.sampleURL case .original: - post.fileURL + currentPost.fileURL } } @@ -43,6 +43,10 @@ struct PostDetailsView: View { return sourcePosts.filter { settings.displayRatings.contains($0.rating) } } + private var currentPost: BooruPost { + manager.selectedPost ?? post + } + var body: some View { VStack(spacing: 0) { #if os(macOS) @@ -50,20 +54,20 @@ struct PostDetailsView: View { url: imageURL, loadingStage: $loadingStage, finalLoadingState: .loaded, - post: post + post: currentPost ) { PostDetailsImageView( - url: post.previewURL, + url: currentPost.previewURL, loadingStage: $loadingStage ) - .id(post.previewURL) + .id(currentPost.previewURL) } .id(imageURL) #else PostDetailsCarouselView( posts: filteredPosts, loadingStage: $loadingStage, - focusedPost: post + focusedPost: currentPost ) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) #endif @@ -71,7 +75,7 @@ struct PostDetailsView: View { if settings.displayDetailsInformationBar { VStack(spacing: 5) { HStack { - Text(post.createdAt.formatted()) + Text(currentPost.createdAt.formatted()) .frame(maxWidth: .infinity, alignment: .leading) Group { @@ -119,6 +123,10 @@ struct PostDetailsView: View { } } + ToolbarItem { + PostGridFavoriteButtonView(post: currentPost) + } + #if os(macOS) if settings.enableShareShortcut { ToolbarItem { @@ -146,7 +154,7 @@ struct PostDetailsView: View { PostDetailsTagsView( isPresented: $isTagsSheetPresented, navigationPath: $navigationPath, - tags: post.tags, + tags: currentPost.tags, isNestedContext: posts != nil, baseSearchText: baseSearchText ) |