Skip to content

Commit baaccb5

Browse files
Update sidebar.js
1 parent 3c52d5e commit baaccb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ document.addEventListener('DOMContentLoaded', () => {
1010
// --- 1. KIỂM TRA TRẠNG THÁI ĐĂNG NHẬP ---
1111
const userInfo = JSON.parse(localStorage.getItem('userInfo'));
1212
const isLoggedIn = !!userInfo; // true nếu userInfo tồn tại, ngược lại là false
13-
const userAvatar = userInfo.avatarUrl ? `/${userInfo.avatarUrl}` : '/img/avatar.png';
13+
1414
// --- 2. ĐỊNH NGHĨA HTML CHO CÁC TRẠNG THÁI ---
1515
let sidebarHTML = '';
1616

1717
if (isLoggedIn) {
18+
const userAvatar = userInfo.avatarUrl ? `/${userInfo.avatarUrl}` : '/img/avatar.png';
1819
// --- Giao diện KHI ĐÃ ĐĂNG NHẬP ---
1920
sidebarHTML = `
2021
<a href="/account" class="sidebar-profile-link"> <!-- BỌC TRONG THẺ A -->

0 commit comments

Comments
 (0)