From ed2519848c26585958762de1ffc73b9cf13ba81c Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 16 Jan 2023 10:55:32 -0500 Subject: [PATCH] Prevent all pinned timelines from being removed --- Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift b/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift index ae176dd4..cd188ba5 100644 --- a/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift +++ b/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift @@ -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