From 05c837121c9b6b5f5cdbe0b5f6f6128f8906f826 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Tue, 24 Dec 2024 13:19:16 +0100 Subject: [PATCH 1/2] fix rewards toast notification not closing --- src/blocks/notification/Notification.tsx | 5 ++--- src/common/hooks/useRewardsNotification.tsx | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blocks/notification/Notification.tsx b/src/blocks/notification/Notification.tsx index 8fefbe50af..390c3f1f5f 100644 --- a/src/blocks/notification/Notification.tsx +++ b/src/blocks/notification/Notification.tsx @@ -75,7 +75,7 @@ const NotificationItem: FC = ({ overlay, onClose, title, desc const handleNotificationClick = () => onClick?.(); const handleNotificationClose = () => { onClose?.(); - notification.hide(); + console.log('close close'); }; return ( @@ -127,8 +127,7 @@ const notification = { }, hide: () => { if (toastIds.length > 0) { - const toastId = toastIds.pop(); - toast.dismiss(toastId); + toast.dismiss(); } }, }; diff --git a/src/common/hooks/useRewardsNotification.tsx b/src/common/hooks/useRewardsNotification.tsx index 7c685f2b89..72d7f413a3 100644 --- a/src/common/hooks/useRewardsNotification.tsx +++ b/src/common/hooks/useRewardsNotification.tsx @@ -27,6 +27,7 @@ export const useRewardsNotification = () => { }, onClose: () => { localStorage.setItem(CommonLocalStorageKeys.notificationShown, 'true'); + notification.hide(); }, }); From b4d20d8513546d294bf0111bd5ea961665428d40 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Tue, 24 Dec 2024 13:25:44 +0100 Subject: [PATCH 2/2] remove console --- src/blocks/notification/Notification.tsx | 2 +- src/common/hooks/useRewardsNotification.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/blocks/notification/Notification.tsx b/src/blocks/notification/Notification.tsx index 390c3f1f5f..3cce205613 100644 --- a/src/blocks/notification/Notification.tsx +++ b/src/blocks/notification/Notification.tsx @@ -75,7 +75,7 @@ const NotificationItem: FC = ({ overlay, onClose, title, desc const handleNotificationClick = () => onClick?.(); const handleNotificationClose = () => { onClose?.(); - console.log('close close'); + notification.hide(); }; return ( diff --git a/src/common/hooks/useRewardsNotification.tsx b/src/common/hooks/useRewardsNotification.tsx index 72d7f413a3..7c685f2b89 100644 --- a/src/common/hooks/useRewardsNotification.tsx +++ b/src/common/hooks/useRewardsNotification.tsx @@ -27,7 +27,6 @@ export const useRewardsNotification = () => { }, onClose: () => { localStorage.setItem(CommonLocalStorageKeys.notificationShown, 'true'); - notification.hide(); }, });