From 245f13d59f4424fbf16ace245ca31f8f0b7d5867 Mon Sep 17 00:00:00 2001 From: Hao Song Date: Tue, 2 Jan 2024 09:50:50 -0800 Subject: [PATCH] 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 --- IceCubesApp/App/Tabs/Settings/SettingsTab.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 1a4279d8..213efc11 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -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() } }