Skip to content

Commit

Permalink
Merge pull request #87 from DDD-Community/feat/#58
Browse files Browse the repository at this point in the history
[feat/#58] 초기 알람값이 없을 때, 알림 켜기 버튼이 ON 이 안되는 이슈 수정
  • Loading branch information
G-hoon authored Sep 25, 2024
2 parents bf76edb + 7a23e08 commit 19dcc0a
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/components/Posture/PostrueCrew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,25 @@ export default function PostrueCrew(props: PostureCrewProps): ReactElement {
}

const onClickNotiAlarm = (): void => {
updateNotiMutation.mutate(
{ isActive: !notification?.isActive, duration: notification?.duration },
{
onSuccess: (data: notification) => {
console.log("#### : ", data)
setNotification(data)
},
}
)
if (!notification || !notification.isActive) {
updateNotiMutation.mutate(
{ isActive: true, duration: notification?.duration || "IMMEDIATELY" },
{
onSuccess: (data: notification) => {
setNotification(data)
},
}
)
} else {
updateNotiMutation.mutate(
{ isActive: !notification?.isActive, duration: notification?.duration },
{
onSuccess: (data: notification) => {
setNotification(data)
},
}
)
}
}

const onClickPostureGuide = () => {
Expand Down

0 comments on commit 19dcc0a

Please sign in to comment.