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
1 changed files with 2 additions and 2 deletions

View File

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