Skip to content

Commit d92f8e5

Browse files
authored
Stop next-cycle highlight after scan limit
- Stop auto item scanning as soon as the configured scan-cycle limit is reached - Prevent cycle-break startup from taking precedence over the max-cycle stop path - Treat overshot cycle counts as stopped so scanning cannot continue past the configured cap 🤖 Auto-generated
1 parent 0e9e0ee commit d92f8e5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/main/java/com/enaboapps/switchify/service/scanning/tree/ScanTree.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ class ScanTree(
295295
"Cycle is completed with navigator cycle break: ${navigator.isInCycleBreak}"
296296
)
297297
callback?.onSingleCycleCompleted(navigator.currentCycle)
298+
if (handleAutoScanCycleLimit()) {
299+
return true
300+
}
298301
if (navigator.isInCycleBreak) {
299302
callback?.onScanTreeCycleBreakStarted()
300303
return true

app/src/main/java/com/enaboapps/switchify/service/scanning/tree/ScanTreeNavigator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class ScanTreeNavigator(
395395
*/
396396
fun isAutoScanCycleLimitReached(): Boolean {
397397
val userDefinedCycles = scanSettings.getScanCycles()
398-
return currentCycle == userDefinedCycles && scanSettings.isAutoScanMode()
398+
return currentCycle >= userDefinedCycles && scanSettings.isAutoScanMode()
399399
}
400400

401401
/**

0 commit comments

Comments
 (0)