diff --git a/app/components/ReportForm.vue b/app/components/ReportForm.vue index 650e689..fa72ecd 100644 --- a/app/components/ReportForm.vue +++ b/app/components/ReportForm.vue @@ -45,7 +45,6 @@ const isResolvingAddress = ref(false) const addressSearchError = ref('') const showAddressSuggestions = ref(false) -// Map variables const mapContainer = ref(null) let leaflet: typeof import('leaflet') | null = null let map: LeafletMap | null = null @@ -62,7 +61,6 @@ const loadLeaflet = async () => { const leafletModule = await import('leaflet') - // Fix per le icone di Leaflet in Nuxt/Vite const defaultIcon = leafletModule.icon({ iconUrl: 'https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png', iconRetinaUrl: 'https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png', @@ -276,7 +274,6 @@ const initMap = async () => { void updateLocation(e.latlng.lat, e.latlng.lng) }) - // Se c'è già una posizione, imposta il marker if (form.value.latitude && form.value.longitude) { void updateLocation(form.value.latitude, form.value.longitude, { zoomTo: true }) } @@ -435,7 +432,6 @@ watch(() => form.value.address, (newAddress) => { }, 350) }) -// Sincronizza input manuali con la mappa watch([() => form.value.latitude, () => form.value.longitude], ([newLat, newLng]) => { if (newLat && newLng && map && leaflet) { if (!marker || marker.getLatLng().lat !== newLat || marker.getLatLng().lng !== newLng) { diff --git a/app/middleware/auth.ts b/app/middleware/auth.ts index 9292130..46b3079 100644 --- a/app/middleware/auth.ts +++ b/app/middleware/auth.ts @@ -1,7 +1,6 @@ export default defineNuxtRouteMiddleware(async (to) => { const auth = useAuth() - // Se c'è un token ma l'utente non è ancora caricato e non stiamo già sincronizzando, sincronizza if ((auth.token.value || auth.tokenState.value) && !auth.user.value && !auth.isSyncingUser.value) { try { await auth.syncUser({ currentPath: to.path }) @@ -11,12 +10,10 @@ export default defineNuxtRouteMiddleware(async (to) => { } } - // Se non autenticato, redirige al login if (!auth.isAuthenticated.value) { return navigateTo('/auth/login') } - // Verifica ruoli se richiesto const requiredRole = to.meta.auth?.role if (requiredRole && auth.user.value) { diff --git a/app/pages/admin/users.vue b/app/pages/admin/users.vue index 67ccd02..1e1af4c 100644 --- a/app/pages/admin/users.vue +++ b/app/pages/admin/users.vue @@ -68,7 +68,6 @@ const handleToggleBan = async () => { } } -// Modal per i ruoli const editingUserId = ref(null) const selectedRoles = ref([]) const availableRoles = ['CITIZEN', 'OPERATOR', 'ADMIN'] diff --git a/app/pages/auth/login.vue b/app/pages/auth/login.vue index 38ccab9..50ceafe 100644 --- a/app/pages/auth/login.vue +++ b/app/pages/auth/login.vue @@ -9,7 +9,6 @@ useHead({ title: 'Accedi - Visione' }) const { requestOtp, verifyOtp, handleLoginSuccess } = useAuth() -// UI State const otpStep = ref<1 | 2>(1) const isLoading = ref(false) const errorMessage = ref('') diff --git a/app/pages/info.vue b/app/pages/info.vue index e5f9c76..9b2b089 100644 --- a/app/pages/info.vue +++ b/app/pages/info.vue @@ -1,5 +1,4 @@