-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcountdownTest.js
More file actions
23 lines (19 loc) · 888 Bytes
/
countdownTest.js
File metadata and controls
23 lines (19 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function getURLParameter(name) {
return decodeURIComponent((new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(location.search) || [null, ""])[1].replace(/\+/g, "%20")) || null;
}
firebase.auth().onAuthStateChanged(function() {
var countdownDate = new Date("Nov 24, 2018 16:00:00").getTime();
var now = new Date().getTime();
var distance = countdownDate - now;
if (distance > 0) {
if (getURLParameter("unlockCountdown") == "true") {
localStorage.setItem("unlockCountdown", "true");
}
if (getURLParameter("unlockCountdown") == "false") {
localStorage.setItem("unlockCountdown", "false");
}
if (!isStaff(currentUid) && getURLParameter("bypassCountdown") != "true" && localStorage.getItem("unlockCountdown") != "true") {
window.location.href = "countdown.html";
}
}
});