Skip to content

Commit a73a51e

Browse files
committed
v1.5.2: Fix hub user interface display and Persian calendar accuracy
- Fixed hub userAvatar, userName, userMobile display issues - Resolved Persian calendar day alignment for year 1404 (2025) - Enhanced error handling in hub JavaScript - Improved calendar date conversion algorithm - Updated user interface with proper debugging
1 parent e8d3bfd commit a73a51e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

‎src/webviews/hub.html‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@
533533
<!-- User Section -->
534534
<div class="user-section">
535535
<div id="userCard" class="user-card" style="display: none;">
536-
<!-- <div class="user-avatar" id="userAvatar"></div> -->
536+
<!-- <div class="user-avatar" id="userAvatar">👤</div> -->
537537
<div class="user-info">
538538
<h3 id="userName">نام کاربر</h3>
539539
<p id="userMobile">موبایل کاربر</p>
@@ -658,7 +658,10 @@ <h3>نظرتان مهم است</h3>
658658
const loginPrompt = document.getElementById('loginPrompt');
659659
const headerTitle = document.querySelector('h1');
660660

661+
console.log('Hub: Received user data:', userData); // Debug log
662+
661663
if (userData && userData.token) {
664+
console.log('Hub: User is logged in, updating interface'); // Debug log
662665
// Show user card
663666
userCard.style.display = 'block';
664667
loginPrompt.style.display = 'none';
@@ -670,15 +673,22 @@ <h3>نظرتان مهم است</h3>
670673
// Update user info
671674
const initials = fullName.split(' ').map(n => n[0]).join('');
672675

673-
document.getElementById('userAvatar').textContent = initials;
674-
document.getElementById('userName').textContent = fullName;
675-
document.getElementById('userMobile').textContent = userData.user.data.mobile;
676+
const userAvatar = document.getElementById('userAvatar');
677+
const userName = document.getElementById('userName');
678+
const userMobile = document.getElementById('userMobile');
679+
680+
if (userAvatar) userAvatar.textContent = initials;
681+
if (userName) userName.textContent = fullName;
682+
if (userMobile) userMobile.textContent = userData.user.data.mobile;
676683

677684
if (userData.user.financial && userData.user.financial.credit !== undefined) {
678-
document.getElementById('userCredit').textContent =
679-
userData.user.financial.credit.toLocaleString('fa-IR') + ' تومان';
685+
const userCredit = document.getElementById('userCredit');
686+
if (userCredit) {
687+
userCredit.textContent = userData.user.financial.credit.toLocaleString('fa-IR') + ' تومان';
688+
}
680689
}
681690
} else {
691+
console.log('Hub: User not logged in, showing login prompt'); // Debug log
682692
// Show login prompt
683693
userCard.style.display = 'none';
684694
loginPrompt.style.display = 'block';

0 commit comments

Comments
 (0)