Spaces:
Sleeping
Sleeping
Đỗ Hải Nam commited on
Commit ·
5a43934
1
Parent(s): f6ffb2a
fix: use pochi.jpeg for favicon and default avatar
Browse files- frontend/index.html +1 -1
- frontend/public/favicon.jpeg +3 -0
- frontend/public/favicon.png +3 -0
- frontend/src/App.jsx +15 -2
frontend/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
-
<link rel="icon" type="image/
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 8 |
<title>Pochi</title>
|
| 9 |
<!-- Prevent FOUC: Apply theme class before CSS loads -->
|
|
|
|
| 3 |
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
+
<link rel="icon" type="image/jpeg" href="/favicon.jpeg" />
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 8 |
<title>Pochi</title>
|
| 9 |
<!-- Prevent FOUC: Apply theme class before CSS loads -->
|
frontend/public/favicon.jpeg
ADDED
|
|
Git LFS Details
|
frontend/public/favicon.png
ADDED
|
|
Git LFS Details
|
frontend/src/App.jsx
CHANGED
|
@@ -7,7 +7,7 @@ import { SearchModal, ImageViewer, SettingsModal } from './components/Modals'
|
|
| 7 |
import { Menu, MoreHorizontal } from 'lucide-react'
|
| 8 |
import './App.css'
|
| 9 |
import GuideTour from './components/GuideTour'
|
| 10 |
-
import defaultAvatar from './assets/
|
| 11 |
|
| 12 |
const API_BASE = '/api'
|
| 13 |
|
|
@@ -34,7 +34,20 @@ function App() {
|
|
| 34 |
// User Profile State
|
| 35 |
const [userProfile, setUserProfile] = useState(() => {
|
| 36 |
const saved = localStorage.getItem('user_profile')
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
name: 'Guest',
|
| 39 |
email: 'guest@example.com',
|
| 40 |
avatar: defaultAvatar
|
|
|
|
| 7 |
import { Menu, MoreHorizontal } from 'lucide-react'
|
| 8 |
import './App.css'
|
| 9 |
import GuideTour from './components/GuideTour'
|
| 10 |
+
import defaultAvatar from './assets/pochi.jpeg'
|
| 11 |
|
| 12 |
const API_BASE = '/api'
|
| 13 |
|
|
|
|
| 34 |
// User Profile State
|
| 35 |
const [userProfile, setUserProfile] = useState(() => {
|
| 36 |
const saved = localStorage.getItem('user_profile')
|
| 37 |
+
if (saved) {
|
| 38 |
+
try {
|
| 39 |
+
const profile = JSON.parse(saved)
|
| 40 |
+
// Migrate old static paths to new hashed assets
|
| 41 |
+
if (profile.avatar === '/hnam.jpeg' || profile.avatar === '/pochi.jpeg' || profile.avatar.includes('hnam')) {
|
| 42 |
+
profile.avatar = defaultAvatar
|
| 43 |
+
localStorage.setItem('user_profile', JSON.stringify(profile))
|
| 44 |
+
}
|
| 45 |
+
return profile
|
| 46 |
+
} catch (e) {
|
| 47 |
+
console.error('Failed to parse user_profile', e)
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
return {
|
| 51 |
name: 'Guest',
|
| 52 |
email: 'guest@example.com',
|
| 53 |
avatar: defaultAvatar
|