Create new lists from timeline home menu even if no lists

This commit is contained in:
Thomas Ricouard 2024-01-08 18:22:32 +01:00
parent 6af0c36740
commit e725b6be4d

View file

@ -241,19 +241,17 @@ struct TimelineTab: View {
@ViewBuilder
private var listsFiltersButons: some View {
if !currentAccount.lists.isEmpty {
Menu("timeline.filter.lists") {
ForEach(currentAccount.sortedLists) { list in
Button {
timeline = .list(list: list)
} label: {
Label(list.title, systemImage: "list.bullet")
}
}
Menu("timeline.filter.lists") {
Button {
routerPath.presentedSheet = .listCreate
} label: {
Label("account.list.create", systemImage: "plus")
}
ForEach(currentAccount.sortedLists) { list in
Button {
routerPath.presentedSheet = .listCreate
timeline = .list(list: list)
} label: {
Label("account.list.create", systemImage: "plus")
Label(list.title, systemImage: "list.bullet")
}
}
}