diff --git a/public/js/views/map.js b/public/js/views/map.js index 6338972..7afe043 100644 --- a/public/js/views/map.js +++ b/public/js/views/map.js @@ -217,11 +217,17 @@ const MapView = { this.map.removeSource('radius-circle'); } - // маркер "Я" + // маркер "Я" (клик → свой профиль) this.selfMarkerEl = this.makeMarkerEl( - '
', + '', 18 ); + this.selfMarkerEl.addEventListener('click', () => { + const me = API.Store.user; + if (me && (me.id || me.user_id)) { + App.showView('profile'); + } + }); this.selfMarkerObj = new maplibregl.Marker({ element: this.selfMarkerEl }) .setLngLat([lng, lat]) .addTo(this.map); diff --git a/public/js/views/profile.js b/public/js/views/profile.js index 0dd6533..90383cc 100644 --- a/public/js/views/profile.js +++ b/public/js/views/profile.js @@ -222,6 +222,7 @@ const UserProfileView = { ]); this.data = user.user || user; const u = this.data; + console.log('[UserProfile] loaded:', u && u.id, 'stats:', stats); const init = ((u.name || u.email || '?')[0] || '?').toUpperCase(); const rating = stats.rating_avg ? Number(stats.rating_avg).toFixed(1) : '—'; const reviewsCount = stats.rating_count || 0; @@ -229,10 +230,11 @@ const UserProfileView = { document.getElementById('up-content').innerHTML = `