@@ -2,18 +2,12 @@ import 'package:cloud_firestore/cloud_firestore.dart';
2
2
import 'package:hooks_riverpod/hooks_riverpod.dart' ;
3
3
import 'package:pilll/provider/database.dart' ;
4
4
import 'package:pilll/entity/pill_sheet_modified_history.codegen.dart' ;
5
- import 'package:pilll/utils/datetime/day.dart' ;
6
5
7
6
final pillSheetModifiedHistoriesProvider = StreamProvider .family.autoDispose ((ref, DateTime ? afterCursor) {
8
7
if (afterCursor != null ) {
9
8
return ref
10
9
.watch (databaseProvider)
11
10
.pillSheetModifiedHistoriesReference ()
12
- .where (
13
- PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate,
14
- isLessThanOrEqualTo: today ().add (const Duration (days: 1 )),
15
- isGreaterThanOrEqualTo: today ().subtract (const Duration (days: PillSheetModifiedHistoryServiceActionFactory .limitDays)),
16
- )
17
11
.orderBy (PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate, descending: true )
18
12
.startAfter ([afterCursor])
19
13
.limit (20 )
@@ -24,11 +18,6 @@ final pillSheetModifiedHistoriesProvider = StreamProvider.family.autoDispose((re
24
18
return ref
25
19
.watch (databaseProvider)
26
20
.pillSheetModifiedHistoriesReference ()
27
- .where (
28
- PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate,
29
- isLessThanOrEqualTo: today ().add (const Duration (days: 1 )),
30
- isGreaterThanOrEqualTo: today ().subtract (const Duration (days: PillSheetModifiedHistoryServiceActionFactory .limitDays)),
31
- )
32
21
.orderBy (PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate, descending: true )
33
22
.limit (20 )
34
23
.snapshots ()
@@ -40,11 +29,6 @@ final pillSheetModifiedHistoriesWithLimitProvider = StreamProvider.family((ref,
40
29
return ref
41
30
.watch (databaseProvider)
42
31
.pillSheetModifiedHistoriesReference ()
43
- .where (
44
- PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate,
45
- isLessThanOrEqualTo: today ().add (const Duration (days: 1 )),
46
- isGreaterThanOrEqualTo: today ().subtract (const Duration (days: PillSheetModifiedHistoryServiceActionFactory .limitDays)),
47
- )
48
32
.orderBy (PillSheetModifiedHistoryFirestoreKeys .estimatedEventCausingDate, descending: true )
49
33
.limit (limit)
50
34
.snapshots ()
0 commit comments