Allow reordering of remote timelines (#1240)

The reordering of remote timelines is now available. See #1239

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
This commit is contained in:
Paul Schuetz 2023-03-14 07:22:17 +01:00 committed by GitHub
parent 0e3d174625
commit ff9bfe9285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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 {