From 5e5090179e8d28797ff8804601d851cf9b6071c7 Mon Sep 17 00:00:00 2001 From: hhhello Date: Thu, 27 Jun 2024 14:09:56 +0900 Subject: [PATCH] fix: AlimoNotification --- .../Component/Notification/AlimoNotification.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/ADS/Component/Notification/AlimoNotification.swift b/Sources/ADS/Component/Notification/AlimoNotification.swift index 7ac9597..2fd0ebf 100644 --- a/Sources/ADS/Component/Notification/AlimoNotification.swift +++ b/Sources/ADS/Component/Notification/AlimoNotification.swift @@ -13,7 +13,7 @@ public struct AlimoNotification: View { private let title: String private let user: String private let content: String - @State private var isSelected: Bool + @Binding private var isSelected: Bool private let profileUrl: String? private let imageUrl: String? private let date: Date @@ -24,7 +24,7 @@ public struct AlimoNotification: View { _ title: String, user: String, content: String, - isSelected: Bool, + isSelected: Binding, profileUrl: String? = nil, imageUrl: String? = nil, date: Date, @@ -34,7 +34,7 @@ public struct AlimoNotification: View { self.title = title self.user = user self.content = content - self.isSelected = isSelected + self._isSelected = isSelected self.profileUrl = profileUrl self.imageUrl = imageUrl self.date = date @@ -109,9 +109,8 @@ public struct AlimoNotification: View { AlimoColor.Color.primary60 : AlimoColor.Label.alt) .frame(size: 28) .button { - - bookmarkAction() - isSelected.toggle() + bookmarkAction() + isSelected.toggle() } } @@ -127,7 +126,7 @@ public struct AlimoNotification: View { "title", user: "user", content: "content", - isSelected: false, + isSelected: .constant(false), date: .now, addEmojiAction: {