diff --git a/static/js/app/userMenu.js b/static/js/app/userMenu.js index cea05e8a..602483c8 100644 --- a/static/js/app/userMenu.js +++ b/static/js/app/userMenu.js @@ -203,7 +203,9 @@ function updateUserMenuData() { const storageFill = document.getElementById('user-menu-storage-fill'); const storageText = document.getElementById('user-menu-storage-text'); - if (userData.username && userData.id) { + // Username is optional (PR 16) — gate on `id` only; the avatar + // mount needs the UUID, not the handle. + if (userData.id) { _mountAvatarVignettes(userData.id); } @@ -237,8 +239,10 @@ async function fetchAppVersion() { function showUserProfileModal() { const USER_DATA_KEY = 'oxicloud_user'; const userData = JSON.parse(localStorage.getItem(USER_DATA_KEY) || '{}'); - const username = userData.username || 'User'; + // Username is optional (PR 16); fall back to email so usernameless + // recipients (magic-link sign-ins) still get a recognizable label. const email = userData.email || ''; + const username = userData.username || email || 'User'; const role = userData.role || 'user'; const initials = username.substring(0, 2).toUpperCase(); const usedBytes = userData.storage_used_bytes || 0; diff --git a/static/js/views/admin/admin.js b/static/js/views/admin/admin.js index 675648ae..6bcd5843 100644 --- a/static/js/views/admin/admin.js +++ b/static/js/views/admin/admin.js @@ -241,7 +241,7 @@ async function loadUsers() { return ( '' + '
' + - escapeHtml(u.username) + + escapeHtml(u.username || u.email || '—') + (isSelf ? ` ${escapeHtml(i18n.t('admin.you_badge'))}` : '') + '' + escapeHtml(u.email) + @@ -274,7 +274,7 @@ async function loadUsers() { '') + @@ -316,7 +316,7 @@ async function loadUsers() { '