Prevent all pinned timelines from being removed

This commit is contained in:
Shadowfacts 2023-01-16 10:55:32 -05:00
parent b1374b12a3
commit ed2519848c
1 changed files with 2 additions and 2 deletions

View File

@ -49,9 +49,9 @@ struct PinnedTimelinesView: View {
.onMove { indices, newOffset in
pinnedTimelines.move(fromOffsets: indices, toOffset: newOffset)
}
.onDelete { indices in
.onDelete(perform: pinnedTimelines.count == 1 ? nil : { indices in
pinnedTimelines.remove(atOffsets: indices)
}
})
Menu {
ForEach([Timeline.home, .public(local: true), .public(local: false)], id: \.id) { timeline in