feature/profile-redesign #12

Merged
Ichitux merged 9 commits from feature/profile-redesign into main 2026-07-06 23:54:37 +00:00
2 changed files with 60 additions and 0 deletions
Showing only changes of commit 4f36820d34 - Show all commits
+30
View File
@@ -92,6 +92,21 @@ function PublicView({
setUserPosition({ lat: savedLat, lon: savedLon });
setPositionSource('profile');
setSortByDistance(true);
// Save to search history
try {
fetch('/api/search-history', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
address: currentUser?.address,
latitude: savedLat,
longitude: savedLon,
}),
});
} catch (err) {
console.error('Error saving search history:', err);
}
return;
}
if (userPosition) {
@@ -104,6 +119,21 @@ function PublicView({
setUserPosition(pos);
setPositionSource('browser');
setSortByDistance(true);
// Save to search history
try {
fetch('/api/search-history', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
address: 'Ubicación actual',
latitude: pos.lat,
longitude: pos.lon,
}),
});
} catch (err) {
console.error('Error saving search history:', err);
}
} catch (err) {
console.error('[location] error', err);
let msg;
+30
View File
@@ -120,6 +120,21 @@ function SearchView({ currentUser, onLoginRequest }) {
setUserPosition({ lat: savedLat, lon: savedLon });
setPositionSource('profile');
setSortByDistance(true);
// Save to search history
try {
fetch('/api/search-history', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
address: currentUser?.address,
latitude: savedLat,
longitude: savedLon,
}),
});
} catch (err) {
console.error('Error saving search history:', err);
}
return;
}
if (userPosition) {
@@ -132,6 +147,21 @@ function SearchView({ currentUser, onLoginRequest }) {
setUserPosition(pos);
setPositionSource('browser');
setSortByDistance(true);
// Save to search history
try {
fetch('/api/search-history', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
address: 'Ubicación actual',
latitude: pos.lat,
longitude: pos.lon,
}),
});
} catch (err) {
console.error('Error saving search history:', err);
}
} catch (err) {
let msg = 'No se pudo obtener tu ubicación';
if (err && typeof err.code === 'number') {