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:
parent
7b19979118
commit
87e38649c4
1 changed files with 7 additions and 5 deletions
|
|
@ -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';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue