mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 09:36:58 +00:00
Fix 5 TestFlight crash types from builds 250-254
- Fix BGTaskScheduler assertion crash on Mac Catalyst by guarding all iOS background task APIs with isMacCatalystApp check - Fix iPad popover crash in UIPopoverPresentationController by adding .presentationCompactAdaptation(.sheet) to all 27 confirmationDialogs - Fix SwiftData assertion crash when accessing deleted Bookmark model properties during SwiftUI hit testing in BookmarkRowView - Fix UICollectionView invalid item count crash on queue swipe-to-delete by using ID-based removal with withAnimation instead of stale index - Fix Range crash in storyboard download when storyboardCount is zero
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
// Row view for displaying bookmarked videos with tags and notes.
|
||||
//
|
||||
|
||||
import SwiftData
|
||||
import SwiftUI
|
||||
|
||||
/// Row view for displaying bookmarked videos.
|
||||
@@ -30,15 +31,21 @@ struct BookmarkRowView: View {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
}
|
||||
|
||||
private var isBookmarkValid: Bool {
|
||||
bookmark.modelContext != nil && !bookmark.isDeleted
|
||||
}
|
||||
|
||||
private var video: Video {
|
||||
bookmark.toVideo()
|
||||
}
|
||||
|
||||
private var hasTags: Bool {
|
||||
!bookmark.tags.isEmpty
|
||||
guard isBookmarkValid else { return false }
|
||||
return !bookmark.tags.isEmpty
|
||||
}
|
||||
|
||||
private var hasNote: Bool {
|
||||
guard isBookmarkValid else { return false }
|
||||
if let note = bookmark.note, !note.isEmpty {
|
||||
return true
|
||||
}
|
||||
@@ -56,6 +63,12 @@ struct BookmarkRowView: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if isBookmarkValid {
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
private var content: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
// Video row content
|
||||
videoRowContent
|
||||
|
||||
Reference in New Issue
Block a user