Fix settings done button logic (#1809)

* Fix settings done button logic

With the new customizable tab bar, "Settings" can be rendered directly
as the root view of a tab bar entry instead of as a "modal" presented
from the root view. The "Done" button to dismiss the modal should be
hidden if `isModal` is `false`.

* Hide Settings secondary column button for iPad when presented as a modal
This commit is contained in:
Hao Song 2024-01-02 09:50:50 -08:00 committed by GitHub
parent 442a7938ca
commit 245f13d59f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ struct SettingsTabs: View {
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbar {
if UIDevice.current.userInterfaceIdiom == .phone || isModal {
if isModal {
ToolbarItem {
Button {
dismiss()
@ -62,7 +62,7 @@ struct SettingsTabs: View {
}
}
}
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn {
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn, !isModal {
SecondaryColumnToolbarItem()
}
}