From 92857c8d3a33207404a2dc4f47bf0752fda35080 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Wed, 22 Apr 2026 10:35:29 +0100 Subject: [PATCH] feedback do utilizador --- src/App.jsx | 59 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 2744b03..1332199 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -165,12 +165,12 @@ export default function App() { const locName = userProfile?.location || 'Lisboa, Portugal'; const geoRes = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(locName)}&count=1&language=pt&format=json`); const geoData = await geoRes.json(); - + if (geoData.results && geoData.results.length > 0) { const { latitude, longitude, name, country } = geoData.results[0]; const weatherRes = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t_weather=true&daily=temperature_2m_max,temperature_2m_min&timezone=auto`); const weatherRaw = await weatherRes.json(); - + if (weatherRaw.current_weather && weatherRaw.daily) { setWeatherData({ name: `${name}, ${country || ''}`.replace(/,\s*$/, ''), @@ -210,7 +210,7 @@ export default function App() { } }); if (totalWithColor === 0) return []; - + return Object.entries(colorCounts) .sort((a, b) => b[1] - a[1]) .slice(0, 3) @@ -275,7 +275,7 @@ export default function App() { try { // Guardamos o id se for edição antes de apagar o estado const currentEditId = editingItem ? editingItem.id : null; - + // Navegação instantânea (Optimistic UI Update) setEditingItem(null); setImageUrlDraft(''); @@ -426,7 +426,7 @@ export default function App() { e.preventDefault(); setSavingProfile(true); const fd = new FormData(e.target); - + try { const profileDoc = doc(db, 'artifacts', appId, 'users', user.uid, 'profile', 'data'); const dobDay = fd.get('dobDay'); @@ -907,15 +907,15 @@ export default function App() {
{t('appLanguage')}
- {language === 'PT' ? '🇵🇹 ' + t('portuguese') : - language === 'EN' ? '🇬🇧 ' + t('english') : - language === 'ES' ? '🇪🇸 ' + t('spanish') : - language === 'FR' ? '🇫🇷 ' + t('french') : - language === 'DE' ? '🇩🇪 ' + t('german') : language} + {language === 'PT' ? '🇵🇹 ' + t('portuguese') : + language === 'EN' ? '🇬🇧 ' + t('english') : + language === 'ES' ? '🇪🇸 ' + t('spanish') : + language === 'FR' ? '🇫🇷 ' + t('french') : + language === 'DE' ? '🇩🇪 ' + t('german') : language}