fix(location): 추천 엔진에서 최신 위치 사용하도록 수정
- _generateCandidate(): currentLocationProvider → currentLocationWithFallbackProvider - EnhancedRecommendationNotifier: 동일하게 수정 - 백그라운드 복귀 시 캐시된 위치 대신 실시간 위치 사용
This commit is contained in:
@@ -166,8 +166,8 @@ class RecommendationNotifier extends StateNotifier<AsyncValue<Restaurant?>> {
|
||||
required List<String> selectedCategories,
|
||||
List<String> excludedRestaurantIds = const [],
|
||||
}) async {
|
||||
// 현재 위치 가져오기
|
||||
final location = await _ref.read(currentLocationProvider.future);
|
||||
// 현재 위치 가져오기 (StreamProvider에서 최신 위치 사용)
|
||||
final location = _ref.read(currentLocationWithFallbackProvider).valueOrNull;
|
||||
if (location == null) {
|
||||
throw Exception('위치 정보를 가져올 수 없습니다');
|
||||
}
|
||||
@@ -382,8 +382,8 @@ class EnhancedRecommendationNotifier
|
||||
return;
|
||||
}
|
||||
|
||||
// 현재 위치 가져오기
|
||||
final location = await _ref.read(currentLocationProvider.future);
|
||||
// 현재 위치 가져오기 (StreamProvider에서 최신 위치 사용)
|
||||
final location = _ref.read(currentLocationWithFallbackProvider).valueOrNull;
|
||||
if (location == null) {
|
||||
state = state.copyWith(error: '위치 정보를 가져올 수 없습니다', isLoading: false);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user