fix: try-catch en library-store.load() — evita spinner infinito si tablas no existen
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,12 +38,17 @@ export const useLibraryStore = create<LibraryState>((set, get) => ({
|
||||
|
||||
load: async () => {
|
||||
set({ isLoading: true })
|
||||
const [groups, processes, settings] = await Promise.all([
|
||||
supabaseGroupRepo.getAll(),
|
||||
supabaseProcessRepo.getAll(),
|
||||
supabaseSettingsRepo.get(),
|
||||
])
|
||||
set({ groups, processes, settings, isLoading: false })
|
||||
try {
|
||||
const [groups, processes, settings] = await Promise.all([
|
||||
supabaseGroupRepo.getAll(),
|
||||
supabaseProcessRepo.getAll(),
|
||||
supabaseSettingsRepo.get(),
|
||||
])
|
||||
set({ groups, processes, settings, isLoading: false })
|
||||
} catch (err) {
|
||||
console.error('Error al cargar la biblioteca:', err)
|
||||
set({ isLoading: false })
|
||||
}
|
||||
},
|
||||
|
||||
createGroup: async (name: string) => {
|
||||
|
||||
Reference in New Issue
Block a user