feat(app): stabilize recommendation flow
This commit is contained in:
@@ -64,8 +64,17 @@ class RestaurantRepositoryImpl implements RestaurantRepository {
|
||||
@override
|
||||
Stream<List<Restaurant>> watchRestaurants() async* {
|
||||
final box = await _box;
|
||||
yield box.values.toList();
|
||||
yield* box.watch().map((_) => box.values.toList());
|
||||
final initial = box.values.toList();
|
||||
AppLogger.debug('[restaurant_repo] initial load count: ${initial.length}');
|
||||
yield initial;
|
||||
yield* box.watch().map((event) {
|
||||
final values = box.values.toList();
|
||||
AppLogger.debug(
|
||||
'[restaurant_repo] box watch event -> count: ${values.length} '
|
||||
'(key=${event.key}, deleted=${event.deleted})',
|
||||
);
|
||||
return values;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -17,7 +17,7 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
static const String _keyCategoryWeights = 'category_weights';
|
||||
|
||||
// Default values
|
||||
static const int _defaultDaysToExclude = 7;
|
||||
static const int _defaultDaysToExclude = 14;
|
||||
static const int _defaultMaxDistanceRainy = 500;
|
||||
static const int _defaultMaxDistanceNormal = 1000;
|
||||
static const int _defaultNotificationDelayMinutes = 90;
|
||||
|
||||
Reference in New Issue
Block a user