Skip to content

Commit

Permalink
✨ Fix typo in variable name and add guard in gesture handling
Browse files Browse the repository at this point in the history
Changed the variable name `isUseInteractionEnabled` to `isUserInteractionEnabled` for
consistency. Added a guard statement in gesture handling to prevent
interactions when `isUserInteractionEnabled` is false.
  • Loading branch information
WhiteHyun committed Mar 24, 2024
1 parent ffafd42 commit 95d7e6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ToastItem: Identifiable {
let tint: Color

/// 사용자 상호작용 여부
let isUseInteractionEnabled: Bool
let isUserInteractionEnabled: Bool

// MARK: Timing

Expand All @@ -35,7 +35,7 @@ struct ToastItem: Identifiable {
self.title = title
self.symbol = symbol
self.tint = tint
self.isUseInteractionEnabled = isUseInteractionEnabled
isUserInteractionEnabled = isUseInteractionEnabled
self.duration = duration
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct ToastView: View {
.gesture(
DragGesture(minimumDistance: 0)
.onEnded { value in
guard item.isUserInteractionEnabled else { return }
let endY = value.translation.height
let velocityY = value.velocity.height

Expand Down

0 comments on commit 95d7e6b

Please sign in to comment.