From 06c7e0e324dd1ace98fda8d9f613edae17d4d7c7 Mon Sep 17 00:00:00 2001 From: David Davies-Payne Date: Thu, 26 Jan 2023 00:55:07 +1300 Subject: [PATCH] Sort lists and tags in timeline filter button menus (#370) Sorted alphabetically by list.title and tag.name --- IceCubesApp/App/Tabs/Timeline/TimelineTab.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift index 915f0d41..02169e14 100644 --- a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift +++ b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift @@ -83,8 +83,9 @@ struct TimelineTab: View { } } if !currentAccount.lists.isEmpty { + let sortedLists = currentAccount.lists.sorted { $0.title < $1.title } Menu("timeline.filter.lists") { - ForEach(currentAccount.lists) { list in + ForEach(sortedLists) { list in Button { timeline = .list(list: list) } label: { @@ -95,8 +96,9 @@ struct TimelineTab: View { } if !currentAccount.tags.isEmpty { + let sortedTags = currentAccount.tags.sorted { $0.name < $1.name } Menu("timeline.filter.tags") { - ForEach(currentAccount.tags) { tag in + ForEach(sortedTags) { tag in Button { timeline = .hashtag(tag: tag.name, accountId: nil) } label: {