Skip to content

Commit

Permalink
chore: notification debug
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Feb 17, 2023
1 parent 07b9210 commit 61f27b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/lib/screens/app_onboarding/loading_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _LoadingScreenState extends SupabaseAuthState<LoadingScreen> {
Future<void> initStudy() async {
final model = context.read<AppState>();
final selectedStudyObjectId = await getActiveSubjectId();
print('Selected study: $selectedStudyObjectId');
print('Subject ID: $selectedStudyObjectId');
if (!mounted) return;
if (selectedStudyObjectId == null) {
if (isUserLoggedIn()) {
Expand Down
11 changes: 6 additions & 5 deletions app/lib/util/schedule_notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ extension Reminders on FlutterLocalNotificationsPlugin {
if (date.isSameDate(DateTime.now()) &&
!StudyUTimeOfDay(hour: date.hour, minute: date.minute).earlierThan(reminder, exact: true)) {
print(
'${DateTime.now()} NOT Scheduled Notification #$currentId: ${task.title}, $date, $reminder, $notificationDetails, ${task.id}',
'${DateTime.now()} NOT Scheduled Notification #$currentId: ${task.title}, ${date.day}, $reminder, $notificationDetails, ${task.id}',
);
break;
print(task.schedule.reminders);
continue;
}
// unlock time: ${task.schedule.completionPeriods.firstWhere((cp) => cp.unlockTime.earlierThan(reminder)).lockTime}
final reminderTime = tz.TZDateTime(tz.local, date.year, date.month, date.day, reminder.hour, reminder.minute);
Expand Down Expand Up @@ -55,11 +56,11 @@ extension Reminders on FlutterLocalNotificationsPlugin {
);
}*/
// DEBUG: List scheduled notifications
if (StudyNotifications.debug) {
print(
//if (StudyNotifications.debug) {
print(
'${DateTime.now()} Scheduled Notification #$currentId: ${task.title}, $reminderTime, $notificationDetails, ${task.id}',
);
}
//}
currentId++;
}
return currentId;
Expand Down

0 comments on commit 61f27b3

Please sign in to comment.