Enhance lesson end detection logic in LiveCardProvider to ensure proper activity termination

This commit is contained in:
2026-03-09 09:35:01 +01:00
parent 96ebd10ed1
commit 9bafd2647f

View File

@@ -412,7 +412,9 @@ class LiveCardProvider extends ChangeNotifier {
} else if (hasActivityStarted &&
!hasDayEnd &&
nextLesson == null &&
now.isAfter(prevLesson!.end)) {
prevLesson != null &&
now.isAfter(prevLesson!.end) &&
today.every((l) => l.end.isBefore(now))) {
debugPrint("Az utolsó óra véget ért. Befejezés...");
PlatformChannel.endLiveActivity();
serverSync.unregister();