Prevent a tab item from being set twice (#2166)

This commit is contained in:
Klaus Dresbach 2024-09-03 10:15:19 +02:00 committed by GitHub
parent 199749b809
commit 1b7720c9c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,27 +15,37 @@ struct TabbarEntriesSettingsView: View {
Section { Section {
Picker("settings.tabs.first-tab", selection: $tabs.firstTab) { Picker("settings.tabs.first-tab", selection: $tabs.firstTab) {
ForEach(Tab.allCases) { tab in ForEach(Tab.allCases) { tab in
tab.label.tag(tab) if tab == tabs.firstTab || !tabs.tabs.contains(tab) {
tab.label.tag(tab)
}
} }
} }
Picker("settings.tabs.second-tab", selection: $tabs.secondTab) { Picker("settings.tabs.second-tab", selection: $tabs.secondTab) {
ForEach(Tab.allCases) { tab in ForEach(Tab.allCases) { tab in
tab.label.tag(tab) if tab == tabs.secondTab || !tabs.tabs.contains(tab) {
tab.label.tag(tab)
}
} }
} }
Picker("settings.tabs.third-tab", selection: $tabs.thirdTab) { Picker("settings.tabs.third-tab", selection: $tabs.thirdTab) {
ForEach(Tab.allCases) { tab in ForEach(Tab.allCases) { tab in
tab.label.tag(tab) if tab == tabs.thirdTab || !tabs.tabs.contains(tab) {
tab.label.tag(tab)
}
} }
} }
Picker("settings.tabs.fourth-tab", selection: $tabs.fourthTab) { Picker("settings.tabs.fourth-tab", selection: $tabs.fourthTab) {
ForEach(Tab.allCases) { tab in ForEach(Tab.allCases) { tab in
tab.label.tag(tab) if tab == tabs.fourthTab || !tabs.tabs.contains(tab) {
tab.label.tag(tab)
}
} }
} }
Picker("settings.tabs.fifth-tab", selection: $tabs.fifthTab) { Picker("settings.tabs.fifth-tab", selection: $tabs.fifthTab) {
ForEach(Tab.allCases) { tab in ForEach(Tab.allCases) { tab in
tab.label.tag(tab) if tab == tabs.fifthTab || !tabs.tabs.contains(tab) {
tab.label.tag(tab)
}
} }
} }
} }