Removed console.log

This commit is contained in:
2026-07-25 22:10:44 -04:00
parent 2438a07eb7
commit 43c200e45e

View File

@@ -23,22 +23,19 @@ export function NotificationProvider({ children }: PropsWithChildren) {
const [popupShowed, setPopupShowed] = useState(false);
const notify = (newNotification: NotificationType, timeout: number) => {
console.log("Changed notification");
setNotification(newNotification);
setNotificationTimeout(timeout);
};
useEffect(() => {
if (!popupShowed && notification !== null) {
console.log("setting timeout")
if (notification === null) {
setPopupShowed(false);
} else if (!popupShowed && notificationTimeout !== Infinity) {
const timeout = setTimeout(() => {
console.log("timeout done")
setPopupShowed(true);
setNotification(null);
}, notificationTimeout);
return () => clearTimeout(timeout);
} else {
setPopupShowed(false);
}
}, [notification, notificationTimeout]);