Skip to content

Commit

Permalink
Show connect to watch toggle only on iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitepower18 committed Jan 31, 2025
1 parent 8122c87 commit 45766a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ struct OtherSettingsView: View {
VStack(alignment: .leading, spacing: 8) {
clearClipboard

connectToWatch
if store.state.shouldShowConnectToWatchToggle {
connectToWatch
}
}
}
.scrollView(padding: 12)
Expand Down

0 comments on commit 45766a7

Please sign in to comment.