|
@@ -244,18 +244,8 @@ async function handleAuthEvent(event) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
function updateHeader(username) {
|
|
function updateHeader(username) {
|
|
|
- const loggedOutDivs = document.querySelectorAll('.forloggedout');
|
|
|
|
|
- const loggedInDivs = document.querySelectorAll('.forloggedin');
|
|
|
|
|
const usernameSpan = document.querySelector('.username');
|
|
const usernameSpan = document.querySelector('.username');
|
|
|
- if (username) {
|
|
|
|
|
- usernameSpan.textContent = username;
|
|
|
|
|
- loggedOutDivs.forEach(div => div.style.display = 'none');
|
|
|
|
|
- loggedInDivs.forEach(div => div.style.display = 'block');
|
|
|
|
|
- } else {
|
|
|
|
|
- usernameSpan.textContent = 'nobody';
|
|
|
|
|
- loggedOutDivs.forEach(div => div.style.display = 'block');
|
|
|
|
|
- loggedInDivs.forEach(div => div.style.display = 'none');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ usernameSpan.textContent = username ? username : 'nobody';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|