Quellcode durchsuchen

update variable

kaori vor 4 Jahren
Ursprung
Commit
c1fee534ed

+ 4 - 4
packages/app/src/components/InAppNotification/InAppNotificationDropdown.tsx

@@ -24,7 +24,6 @@ const InAppNotificationDropdown: FC = (props) => {
 
   useEffect(() => {
     initializeSocket(props);
-    // fetchNotificationList(props);
   }, []);
 
   const initializeSocket = (props) => {
@@ -66,15 +65,16 @@ const InAppNotificationDropdown: FC = (props) => {
     }
   };
 
+
   const toggleDropdownHandler = () => {
     if (isOpen === false && count > 0) {
       updateNotificationStatus();
     }
 
-    const toggleIsOpen = !isOpen;
-    setIsOpen(toggleIsOpen);
+    const newIsOpenState = !isOpen;
+    setIsOpen(newIsOpenState);
 
-    if (toggleIsOpen === true) {
+    if (newIsOpenState === true) {
       fetchNotificationList();
     }
   };