Removed console.log
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user