Skip to content

Commit

Permalink
keeps old talks from being hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
carykees98 committed Sep 9, 2023
1 parent 44328ce commit 806b116
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions static/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ function connect() {
sync();
};
socket.onmessage = function (e) {
const presentWeek = parseInt(Date.parse("YYYYMMDD"));

const data = JSON.parse(e.data);
console.log("Received:", data);
Expand All @@ -134,7 +133,7 @@ function connect() {
addTalk(data.new);
seen.add(data.new.id);
} else if (data.type == 1 || data.type == 2) {
if (!(week < presentWeek)){
if (!past){
// Hide the talk from the table
hideTalk(data.hide.id);
}
Expand Down
5 changes: 4 additions & 1 deletion templates/future.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<head>
<title>Talks</title>
<link rel="stylesheet" type="text/css" href="static/style.css">
<script> const week = {{.Week }}</script>
<script>
const week = {{.Week }};
const past = false;
</script>
<script type="text/javascript" src="static/site.js"></script>
</head>

Expand Down
5 changes: 4 additions & 1 deletion templates/past.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<head>
<title>Talks</title>
<link rel="stylesheet" type="text/css" href="static/style.css">
<script> const week = {{.Week }}</script>
<script>
const week = {{.Week }};
const past = true;
</script>
<script type="text/javascript" src="static/site.js"></script>
</head>

Expand Down

0 comments on commit 806b116

Please sign in to comment.