Fixed an issue with the calendar UI and added timestamps to the session storage for help with database cleaning

This commit is contained in:
ION606
2022-09-25 21:29:53 -04:00
parent 757a965e2f
commit c3e77a3444
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -373,7 +373,7 @@
calSpacing.cellPadding = 1; calSpacing.cellPadding = 1;
} }
// document.getElementById('calHeader').style.display = "block"; //Breaks the calendar document.getElementById('calHeader').style = "";
} }
</script> </script>
+7 -1
View File
@@ -74,8 +74,14 @@ app.post('/user', async(request, response) => {
connection.then((client) => { connection.then((client) => {
const sessionId = uuidv4(); const sessionId = uuidv4();
//Used for database clearing
const d = new Date();
d.setHours(0);
d.setMinutes(0);
d.setSeconds(0);
const dbo = client.db('main').collection('sessions'); const dbo = client.db('main').collection('sessions');
dbo.insertOne({ sessionId: sessionId, userId: id, guilds: JSON.stringify(guilds), currentServer: null }); dbo.insertOne({ sessionId: sessionId, userId: id, guilds: JSON.stringify(guilds), currentServer: null, timeStamp: d.getTime() });
response.send(sessionId); response.send(sessionId);
}); });