From 95d7e6b7e745e171767a6346e359f06fd802fdb2 Mon Sep 17 00:00:00 2001 From: SeungHyun Hong Date: Sun, 24 Mar 2024 16:00:26 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Fix=20typo=20in=20variable=20name?= =?UTF-8?q?=20and=20add=20guard=20in=20gesture=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the variable name `isUseInteractionEnabled` to `isUserInteractionEnabled` for consistency. Added a guard statement in gesture handling to prevent interactions when `isUserInteractionEnabled` is false. --- Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift | 4 ++-- .../DesignSystem/Components/Toast/View/ToastView.swift | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift b/Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift index e5b4844..cdacd0a 100644 --- a/Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift +++ b/Shared/Sources/DesignSystem/Components/Toast/ToastItem.swift @@ -24,7 +24,7 @@ struct ToastItem: Identifiable { let tint: Color /// 사용자 상호작용 여부 - let isUseInteractionEnabled: Bool + let isUserInteractionEnabled: Bool // MARK: Timing @@ -35,7 +35,7 @@ struct ToastItem: Identifiable { self.title = title self.symbol = symbol self.tint = tint - self.isUseInteractionEnabled = isUseInteractionEnabled + isUserInteractionEnabled = isUseInteractionEnabled self.duration = duration } } diff --git a/Shared/Sources/DesignSystem/Components/Toast/View/ToastView.swift b/Shared/Sources/DesignSystem/Components/Toast/View/ToastView.swift index f2897eb..84db7d6 100644 --- a/Shared/Sources/DesignSystem/Components/Toast/View/ToastView.swift +++ b/Shared/Sources/DesignSystem/Components/Toast/View/ToastView.swift @@ -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