diff --git a/desktop/src/scripts/auth-guard.js b/desktop/src/scripts/auth-guard.js index 4dd5548..04a6a7a 100644 --- a/desktop/src/scripts/auth-guard.js +++ b/desktop/src/scripts/auth-guard.js @@ -7,6 +7,7 @@ async function loadMeUI() { const token = localStorage.getItem("token") + if (!token) return try { @@ -31,20 +32,15 @@ async function loadMeUI() { if (dropdownAvatar) dropdownAvatar.src = avatarUrl } - const titlebarUserBox = document.getElementById("titlebar-user-box") - const titlebarUsername = document.getElementById("titlebar-username") const titlebarAvatar = document.getElementById("titlebar-avatar") - const titlebarDropdownAvatar = document.getElementById("titlebar-dropdown-avatar") - const titlebarDropdownUsername = document.getElementById("titlebar-dropdown-username") + const titlebarActions = document.getElementById("titlebar-actions") - if (titlebarUserBox && titlebarUsername && titlebarAvatar) { - titlebarUserBox.style.display = "flex" - - titlebarUsername.textContent = user.username + if (titlebarAvatar) { titlebarAvatar.src = avatarUrl + } - if (titlebarDropdownAvatar) titlebarDropdownAvatar.src = avatarUrl - if (titlebarDropdownUsername) titlebarDropdownUsername.textContent = user.username + if (titlebarActions) { + titlebarActions.style.display = "flex" } setupDropdown() diff --git a/desktop/views/components/titlebar.html b/desktop/views/components/titlebar.html index 20341ac..339df04 100644 --- a/desktop/views/components/titlebar.html +++ b/desktop/views/components/titlebar.html @@ -9,37 +9,20 @@
+