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 [popupShowed, setPopupShowed] = useState(false);
const notify = (newNotification: NotificationType, timeout: number) => { const notify = (newNotification: NotificationType, timeout: number) => {
console.log("Changed notification");
setNotification(newNotification); setNotification(newNotification);
setNotificationTimeout(timeout); setNotificationTimeout(timeout);
}; };
useEffect(() => { useEffect(() => {
if (!popupShowed && notification !== null) { if (notification === null) {
console.log("setting timeout") setPopupShowed(false);
} else if (!popupShowed && notificationTimeout !== Infinity) {
const timeout = setTimeout(() => { const timeout = setTimeout(() => {
console.log("timeout done")
setPopupShowed(true); setPopupShowed(true);
setNotification(null); setNotification(null);
}, notificationTimeout); }, notificationTimeout);
return () => clearTimeout(timeout); return () => clearTimeout(timeout);
} else {
setPopupShowed(false);
} }
}, [notification, notificationTimeout]); }, [notification, notificationTimeout]);