Changeset 82079ad in Klonkt for src/middleware/render.js
- Timestamp:
- 06/24/2026 12:31:43 PM (3 months ago)
- Branches:
- main
- Children:
- 3d7312a
- Parents:
- 52ea6df
- File:
-
- 1 edited
-
src/middleware/render.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/middleware/render.js
r52ea6df r82079ad 73 73 const _fresh = db.prepare('SELECT avatar_url, role, lang FROM users WHERE id = ?').get(_u.id); 74 74 if (_fresh) _u = { ..._u, avatar_url: _fresh.avatar_url, role: _fresh.role, lang: _fresh.lang }; 75 // One identity: no own account avatar → fall back to the user's site photo, 76 // so the same picture shows everywhere (nav, account, comments). 77 if (_u && !_u.avatar_url) { 78 const _sp = db.prepare("SELECT profile_photo FROM sites WHERE owner_id = ? AND profile_photo IS NOT NULL ORDER BY is_primary DESC, created_at ASC LIMIT 1").get(_u.id); 79 if (_sp && _sp.profile_photo) _u = { ..._u, avatar_url: _sp.profile_photo }; 80 } 75 81 } 76 82 const userOwnsSite = !!(_u && _u.role !== 'god' &&
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)