Use business name initial for user avatar instead of first name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-01 09:47:02 -08:00
parent 7b19979118
commit 87e38649c4

View file

@ -111,20 +111,22 @@ const Portal = {
if (data.OK && data.BUSINESS) { if (data.OK && data.BUSINESS) {
const biz = data.BUSINESS; const biz = data.BUSINESS;
this.businessData = biz; // Store for later use this.businessData = biz; // Store for later use
document.getElementById('businessName').textContent = biz.Name || 'Business'; const bizName = biz.Name || 'Business';
document.getElementById('businessAvatar').textContent = (biz.Name || 'B').charAt(0).toUpperCase(); const bizInitial = bizName.charAt(0).toUpperCase();
document.getElementById('userAvatar').textContent = (localStorage.getItem('payfrit_portal_firstname') || 'U').charAt(0).toUpperCase(); document.getElementById('businessName').textContent = bizName;
document.getElementById('businessAvatar').textContent = bizInitial;
document.getElementById('userAvatar').textContent = bizInitial;
} else { } else {
this.businessData = null; this.businessData = null;
document.getElementById('businessName').textContent = 'Business #' + this.config.businessId; document.getElementById('businessName').textContent = 'Business #' + this.config.businessId;
document.getElementById('businessAvatar').textContent = 'B'; document.getElementById('businessAvatar').textContent = 'B';
document.getElementById('userAvatar').textContent = (localStorage.getItem('payfrit_portal_firstname') || 'U').charAt(0).toUpperCase(); document.getElementById('userAvatar').textContent = 'B';
} }
} catch (err) { } catch (err) {
console.error('[Portal] Business info error:', err); console.error('[Portal] Business info error:', err);
document.getElementById('businessName').textContent = 'Business #' + this.config.businessId; document.getElementById('businessName').textContent = 'Business #' + this.config.businessId;
document.getElementById('businessAvatar').textContent = 'B'; document.getElementById('businessAvatar').textContent = 'B';
document.getElementById('userAvatar').textContent = (localStorage.getItem('payfrit_portal_firstname') || 'U').charAt(0).toUpperCase(); document.getElementById('userAvatar').textContent = 'B';
} }
}, },