Skip to content

Commit

Permalink
fix: github file loading errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alfrdkang committed Feb 7, 2024
1 parent 86a731d commit 62cf541
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion js/contact.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//check if user has logged in
if ((localStorage.getItem("id") == null)) {
window.location.href = "/index.html";
window.location.href = "./index.html";
} else {
console.log('Logged in!')
}
4 changes: 2 additions & 2 deletions js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ document.getElementById("usernameeditsubmit").addEventListener("click", async fu
console.log(postResponse.jsondata)

alert("Username Updated!")
window.location.href = "/dashboard.html";
window.location.href = "/StudyPal/dashboard.html";
})

document.getElementById("emaileditsubmit").addEventListener("click", async function(e) {
Expand All @@ -78,6 +78,6 @@ document.getElementById("emaileditsubmit").addEventListener("click", async funct
console.log(postResponse.jsondata)

alert("Email Updated!")
window.location.href = "/dashboard.html";
window.location.href = "./dashboard.html";
})

4 changes: 2 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ document.addEventListener("DOMContentLoaded", async function () {

//check if user is logged in
if ((localStorage.getItem("id") !== null)) {
window.location.href = "/main.html";
window.location.href = "./main.html";
} else {
console.log('Please Login')
}
Expand Down Expand Up @@ -50,7 +50,7 @@ document.addEventListener("DOMContentLoaded", async function () {
localStorage.setItem("room", data[i].room)
localStorage.setItem("studysessionactive", false)

window.location.href = "/main.html";
window.location.href = "./main.html";
break;
} else if (i>=data.length) {
alert('Username or Password is Incorrect! Please Try Again')
Expand Down
8 changes: 4 additions & 4 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const apiurl = "https://studypal-c298.restdb.io/rest/studypalusers"

//check if user has logged in
if ((localStorage.getItem("id") == null)) {
window.location.href = "/index.html";
window.location.href = "./index.html";
} else {
console.log('Logged in!')
}
Expand All @@ -27,20 +27,20 @@ document.getElementById("hamburgermenu").addEventListener("mouseover", function(

const dashboardtoggle = document.getElementById("dashboardtoggle")
dashboardtoggle.addEventListener("click", function() {
window.location.href = "/dashboard.html";
window.location.href = "./dashboard.html";
})

//logout
const logout = document.getElementById("logout")
logout.addEventListener("click", function() {
localStorage.clear();
window.location.href = "/index.html";
window.location.href = "./index.html";
})
const logouthamburger = document.getElementById("logouthamburger")
logouthamburger.addEventListener("click", function() {
console.log('trest')
localStorage.clear();
window.location.href = "/index.html";
window.location.href = "./index.html";
})

document.getElementById("profileusername").innerHTML = localStorage.getItem("username")
Expand Down
2 changes: 1 addition & 1 deletion main.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</a>
<div class="flex items-center lg:order-2 space-x-3 lg:space-x-0 rtl:space-x-reverse">
<button type="button" class="lg:flex hidden text-sm bg-cream rounded-full lg:me-0 focus:ring-4 focus:ring-gray-300" id="userprofile">
<img class="w-12 h-12 rounded-full" src="/images/stupal.png" alt="userpfp">
<img class="w-12 h-12 rounded-full" src="./images/stupal.png" alt="userpfp">
</button>
<!-- Dropdown menu -->
<div class="z-50 lg:w-1/6 w-1/4 h-lg hidden my-4 text-base list-none bg-orange divide-y divide-cream rounded-lg shadow absolute top-24 sm:right-6 md:right-6 lg:right-6 xl:right-24 2xl:right-60" id="userdropdown">
Expand Down

0 comments on commit 62cf541

Please sign in to comment.