diff --git a/httpdocs/theme/react/hooks-app/metaheader/components/DevelopmentAppMenu.js b/httpdocs/theme/react/hooks-app/metaheader/components/DevelopmentAppMenu.js index 3ccf9f9cb..8601a35be 100755 --- a/httpdocs/theme/react/hooks-app/metaheader/components/DevelopmentAppMenu.js +++ b/httpdocs/theme/react/hooks-app/metaheader/components/DevelopmentAppMenu.js @@ -1,114 +1,114 @@ import React , {useEffect, useState, useRef,useContext} from 'react' import MyButton from './function/MyButton'; import {MetaheaderContext} from '../contexts/MetaheaderContext'; const DevelopmentAppMenu = () => { const {state} = useContext(MetaheaderContext); const [dropdownClass, setDropdownClass] = useState(''); const [notification, setNotification] = useState(false); const [notification_count, setNotification_count] = useState(0); const toggleEl = useRef(null); useEffect(() => { document.addEventListener('mousedown',handleClick, false); return () => { document.removeEventListener('mousedown',handleClick, false); }; },[dropdownClass]) useEffect(() => { if(state.user){ let url = state.baseUrl+'/membersetting/notification'; fetch(url,{ mode: 'cors', credentials: 'include' }) .then(response => response.json()) .then(data => { if(data.notifications){ - const nots = data.notifications.filter(note => note.read==false); + const nots = data.notifications.filter(note => note.read==false && note.notification_type==6); if(nots.length>0 && notification_count !== nots.length) { setNotification(true); setNotification_count(nots.length); } } }); } }, []) const handleClick= e => { let cls = ""; if (toggleEl.current.contains(e.target)){ if (dropdownClass === "open"){ if (e.target.className === "btn btn-default dropdown-toggle" || e.target.className === "th-icon"){ cls = ""; } else { cls = "open"; } } else { cls = "open"; } } setDropdownClass(cls); } return (
  • ) } export default DevelopmentAppMenu