Skip to content

Commit

Permalink
refactor: disable past meals filtering temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueSFernandes committed Nov 18, 2024
1 parent 6a4731b commit 5b2568d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ class RestaurantDatabase extends AppDatabase<List<Restaurant>> {
}
});

return filterPastMeals(restaurants);
// TODO: reimplement the filter.

// return filterPastMeals(restaurants);

return restaurants;
}

Future<List<Meal>> getRestaurantMeals(
Expand Down
15 changes: 5 additions & 10 deletions packages/uni_app/lib/model/providers/lazy/restaurant_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ import 'package:uni/model/providers/state_providers.dart';
class RestaurantProvider extends StateProviderNotifier<List<Restaurant>> {
RestaurantProvider() : super(cacheDuration: const Duration(days: 1));

// @override
// Future<List<Restaurant>> loadFromStorage(
// StateProviders stateProviders,
// ) async {
// final restaurantDb = RestaurantDatabase();
// final restaurants = await restaurantDb.getRestaurants();
// return restaurants;
// }

@override
Future<List<Restaurant>> loadFromStorage(
StateProviders stateProviders,
) async {
return loadFromRemote(stateProviders);
final restaurantDb = RestaurantDatabase();
final restaurants = await restaurantDb.getRestaurants();
return restaurants;
}

@override
Expand All @@ -33,6 +26,8 @@ class RestaurantProvider extends StateProviderNotifier<List<Restaurant>> {
final db = RestaurantDatabase();
unawaited(db.saveIfPersistentSession(restaurants));

// TODO: enable past meals filtering after SASUP publishes the new menus (ALSO CHANGE IN THE STORAGE DATABASE!!!!).

// return filterPastMeals(restaurants);
return restaurants;
}
Expand Down

0 comments on commit 5b2568d

Please sign in to comment.