diff options
| author | Alberto Duarte Delgado <alberto@albertoduarte.com> | 2026-04-01 17:29:30 +0100 |
|---|---|---|
| committer | Alberto Duarte Delgado <alberto@albertoduarte.com> | 2026-04-01 17:29:30 +0100 |
| commit | 47538e50cbad770ddeb998904253afcdd51e20f6 (patch) | |
| tree | 996350fba5c88744458faa7a969b3136d189bfa3 /src/features/offices | |
| parent | e22992e29801e04ca4352045c5bd2f36eac1c31c (diff) | |
disponibilidad de reservas, home mejorado y check-in
Diffstat (limited to 'src/features/offices')
| -rw-r--r-- | src/features/offices/hooks/useFavoriteOffices.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/features/offices/hooks/useFavoriteOffices.ts b/src/features/offices/hooks/useFavoriteOffices.ts index 166dd1c..db87d64 100644 --- a/src/features/offices/hooks/useFavoriteOffices.ts +++ b/src/features/offices/hooks/useFavoriteOffices.ts @@ -1,4 +1,5 @@ -import { useEffect, useMemo, useState } from 'react'; +import { useFocusEffect } from 'expo-router'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { favoritesService } from '@/features/offices/services/favoritesService'; import { useAuthSession } from '@/providers/AuthProvider'; import { getErrorMessage } from '@/shared/lib/errors/getErrorMessage'; @@ -34,6 +35,12 @@ export function useFavoriteOffices() { loadFavorites(); }, [user?.uid]); + useFocusEffect( + useCallback(() => { + void loadFavorites(); + }, [user?.uid]) + ); + const favoriteOfficeIdsSet = useMemo( () => new Set(favoriteOfficeIds), [favoriteOfficeIds] |