From 45766a7a97e9212af4611703bde09e6c23969e8f Mon Sep 17 00:00:00 2001 From: infinitepower18 <44692189+infinitepower18@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:58:23 +0000 Subject: [PATCH] Show connect to watch toggle only on iPhone --- .../Settings/Settings/Other/OtherSettingsState.swift | 11 ++++++++++- .../Settings/Settings/Other/OtherSettingsView.swift | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift index 6475def563..f7bf619420 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsState.swift @@ -1,10 +1,12 @@ -import Foundation +import UIKit // MARK: - OtherSettingsState /// An object that defines the current state of the `OtherSettingsView`. /// struct OtherSettingsState { + // MARK: Properties + /// The time after which the clipboard should clear. var clearClipboardValue: ClearClipboardValue = .never @@ -19,4 +21,11 @@ struct OtherSettingsState { /// A toast message to show in the view. var toast: Toast? + + // MARK: Computed Properties + + /// Whether the connect to watch toggle should be shown. + var shouldShowConnectToWatchToggle: Bool { + UIDevice.current.model == "iPhone" + } } diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsView.swift b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsView.swift index f66ab4bcdd..7a5c8e598f 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsView.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Other/OtherSettingsView.swift @@ -24,7 +24,9 @@ struct OtherSettingsView: View { VStack(alignment: .leading, spacing: 8) { clearClipboard - connectToWatch + if store.state.shouldShowConnectToWatchToggle { + connectToWatch + } } } .scrollView(padding: 12)