Update userprofile.html

This commit is contained in:
xfarrow 2024-03-21 08:41:25 +01:00
parent b4b70b524d
commit 09dfcc0069
1 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<body style="display: none;">
<div class="topnav">
<a class="active" href="#home">Home</a>
<a href="#contact">Discover</a>
@ -24,7 +24,7 @@
</div>
</div>
<div class="container" id="container" style="display: none;">
<div class="container" style="display: none;">
<div class="edit-badge" style="display: none;" id="editBadge" onclick="editProfile()">Edit</div>
<header>
<img src="../content/profile-picture-example.jpg" alt="Profile Picture" class="profile-picture">
@ -74,7 +74,6 @@
// Retrieving the logged in user's profile
if (!idToDisplay || idToDisplay === 'me') {
document.getElementById('editBadge').style.display = 'block'; // show edit button
const token = getCookie('token');
// Check whether the token exists
if (!token) {
@ -86,6 +85,7 @@
"authorization": token
}
});
document.getElementById('editBadge').style.display = 'block'; // show edit button
} else {
response = await fetch(`${API_URL}/persons/${idToDisplay}/details`, {
headers: {
@ -97,7 +97,7 @@
const data = await response.json();
if (response.ok) {
populateFields(data.display_name, data.email, data.about_me, data.qualification);
document.getElementById('container').style.display = 'block'; // Show page
document.body.style.display = 'block'; // Show page
} else if (response.status == 401) {
window.location.href = 'login.html';
} else {
@ -117,7 +117,7 @@
alert('Editing');
}
function onSearchButtonClick(){
function onSearchButtonClick() {
alert('Searching for something...');
}
</script>