Skip to content

Commit

Permalink
compare integers for disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaker6 committed Jul 6, 2024
1 parent 8a74903 commit 01f82f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct DigitalCrownView<Header: View, Footer: View>: View {
public var body: some View {
CardView {
VStack(
alignment: .leading,
alignment: .leading,
spacing: style.dimension.directionalInsets1.top
) {
if !(header is EmptyView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ open class DigitalCrownViewModel: CardViewModel {
}

open var isButtonDisabled: Bool {
value == event.outcomeFirstValue
guard let currentDouble = value.doubleValue,
let originalDouble = event.outcomeValueDouble else {
return false
}
return Int(currentDouble) == Int(originalDouble)
}

open var valueForButton: String {
Expand Down

0 comments on commit 01f82f2

Please sign in to comment.