Skip to content

Commit

Permalink
Merge pull request #19 from COSI-Lab/show-old-talks
Browse files Browse the repository at this point in the history
prevents old talks from being hidden
  • Loading branch information
carykees98 authored Sep 7, 2023
2 parents 7705ebd + 10eb940 commit e96afb4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions static/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ function connect() {
sync();
};
socket.onmessage = function (e) {
const date = new Date();
const presentWeek = date.parse("YYYYMMDD");

const data = JSON.parse(e.data);
console.log("Received:", data);

Expand All @@ -132,8 +135,10 @@ function connect() {
addTalk(data.new);
seen.add(data.new.id);
} else if (data.type == 1 || data.type == 2) {
// Hide the talk from the table
hideTalk(data.hide.id);
if (!(week < presentWeek)){
// Hide the talk from the table
hideTalk(data.hide.id);
}
} else if (data.type == 3) {
// Receiving an auth message means we have successfully authenticated
handleAuth(data.auth);
Expand Down

0 comments on commit e96afb4

Please sign in to comment.