diff --git a/src/App.js b/src/App.js index 3952d7b..12bf09d 100644 --- a/src/App.js +++ b/src/App.js @@ -99,6 +99,7 @@ function App() { const [contributor,setContributor] = useState("") const [notifications,setNotifications] = useState([]) + const [closedNotifications,setClosedNotifications] = useState([]) const [notificationLastUpdate,setNotificationLastUpdate] = useState(new Date()) function LZ(digits,numb) { @@ -135,6 +136,9 @@ function App() { .then((data)=>{ if (data.data.length>0) { var newNotifications = [...notifications] + for (var not of closedNotifications) { + newNotifications = newNotifications.filter((not2)=>not2.id!==not.id) + } for (var dat of data.data) { var exists=false for (var not of newNotifications) { @@ -250,7 +254,7 @@ function App() { {contributor.length===0?<> - {if (k.key==='Enter') {setContributor(document.getElementById("username").value)}}} id="username"/> + {if (k.key==='Enter') {setContributor(document.getElementById("username").value)}}} id="username"/> : data.length>0? @@ -287,7 +291,7 @@ function App() {
{notifications.map((not)=>{ - return {var newArr = notifications.filter((no)=>no.id!==not.id); setNotifications(newArr)}} bg="primary"> + return {var newArr = closedNotifications.push(not); setClosedNotifications(newArr)}} bg="primary"> {not.username}