diff --git a/src/components/Posture/PostrueCrew.tsx b/src/components/Posture/PostrueCrew.tsx index 397aef4..28f40bc 100644 --- a/src/components/Posture/PostrueCrew.tsx +++ b/src/components/Posture/PostrueCrew.tsx @@ -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 = () => {