fixed liveactivity issue

- Fixed a bug where if it's less than one hour before the first class, the LiveActivity is created, but if the user rolls back the time to more than one hour before the first class, the LiveActivity does not end."
This commit is contained in:
Geryy 2024-05-13 03:01:18 +02:00 committed by GitHub
parent 75ba5405bb
commit d24c4ec187
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -362,7 +362,12 @@ class LiveCardProvider extends ChangeNotifier {
}
//END
if (hasActivityStarted &&
if (hasActivityStarted && nextLesson != null &&
nextLesson!.start.difference(now).inMinutes > 60) {
debugPrint("Több, mint 1 óra van az első óráig. Befejezés...");
PlatformChannel.endLiveActivity();
hasActivityStarted = false;
} else if (hasActivityStarted &&
!hasDayEnd &&
nextLesson == null &&
now.isAfter(prevLesson!.end)) {