indicador de conexion y logging
All checks were successful
build-and-deploy / build (push) Successful in 23s
build-and-deploy / deploy (push) Successful in 3s

This commit is contained in:
2025-10-11 19:36:19 -06:00
parent c56f06034e
commit 1f087eb6f3
4 changed files with 345 additions and 2 deletions

View File

@@ -47,7 +47,16 @@ export const useMusicStore = defineStore('music', {
const response = await $fetch<{ tracks: Track[] }>('/api/music')
this.tracks = response.tracks || []
} catch (e: any) {
this.error = e?.message || 'Failed to load tracks'
const errorMsg = e?.message || 'Failed to load tracks'
this.error = errorMsg
// Check if it's an auth error
if (e?.statusCode === 401 || e?.statusCode === 403 ||
errorMsg.includes('401') || errorMsg.includes('403') ||
errorMsg.includes('Unauthorized')) {
console.warn('[Music Store] Authentication error detected')
// The useAuth composable will be notified via watch in components
}
} finally {
this.loading = false
}