From ff9bfe9285eab6de765142ec3a17bfa76efdbe53 Mon Sep 17 00:00:00 2001 From: Paul Schuetz Date: Tue, 14 Mar 2023 07:22:17 +0100 Subject: [PATCH] Allow reordering of remote timelines (#1240) The reordering of remote timelines is now available. See #1239 Signed-off-by: Paul Schuetz --- IceCubesApp/App/Tabs/Settings/SettingsTab.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 2dbc1476..d81e6b68 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -266,6 +266,7 @@ struct SettingsTabs: View { _ = preferences.remoteLocalTimelines.remove(at: index) } } + .onMove(perform: moveTimelineItems) .listRowBackground(theme.primaryBackgroundColor) Button { routerPath.presentedSheet = .addRemoteLocalTimeline @@ -279,6 +280,10 @@ struct SettingsTabs: View { .background(theme.secondaryBackgroundColor) } + private func moveTimelineItems(from source: IndexSet, to destination: Int) { + preferences.remoteLocalTimelines.move(fromOffsets: source, toOffset: destination) + } + private var cacheSection: some View { Section("settings.section.cache") { if cachedRemoved {