From f2ca37c6af850d4811def8dfaf68700a93e48734 Mon Sep 17 00:00:00 2001 From: Yurii Surzhykov Date: Thu, 6 Jun 2024 13:01:52 -0700 Subject: [PATCH] Fix searching next available schedule Signed-off-by: Yurii Surzhykov --- .github/workflows/release_feature_github.yaml | 2 -- .../purs/domain/usecase/BuildCurrentLocationStatusUseCase.kt | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release_feature_github.yaml b/.github/workflows/release_feature_github.yaml index 71801da..c03f49d 100644 --- a/.github/workflows/release_feature_github.yaml +++ b/.github/workflows/release_feature_github.yaml @@ -91,8 +91,6 @@ jobs: style: Code Style revert: Reverts default-commit-type: Other Changes - release-name: v1.0.0 - release-name-prefix: "" mention-authors: true mention-new-contributors: true include-compare-link: true diff --git a/location-domain/src/main/java/com/github/yuriisurzhykov/purs/domain/usecase/BuildCurrentLocationStatusUseCase.kt b/location-domain/src/main/java/com/github/yuriisurzhykov/purs/domain/usecase/BuildCurrentLocationStatusUseCase.kt index 7d16599..76d1513 100644 --- a/location-domain/src/main/java/com/github/yuriisurzhykov/purs/domain/usecase/BuildCurrentLocationStatusUseCase.kt +++ b/location-domain/src/main/java/com/github/yuriisurzhykov/purs/domain/usecase/BuildCurrentLocationStatusUseCase.kt @@ -133,12 +133,11 @@ interface BuildCurrentLocationStatusUseCase { if (currentIndex == currentDate.dayOfWeek.value - 1) { val containsSchedule = schedule[currentIndex].scheduleList.find { it.startTime.isAfter(currentTime) } - return if (containsSchedule != null) { - Pair(schedule[currentIndex].dayName, containsSchedule) + if (containsSchedule != null) { + return Pair(schedule[currentIndex].dayName, containsSchedule) } else { if (firstLoopRun) { firstLoopRun = false - continue } else { return null }