Skip to content

Commit 79eab00

Browse files
david-allisonmikehardy
authored andcommitted
refactor: extract 'handleDayRollover'
1 parent 9838a1c commit 79eab00

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/DayRolloverHandler.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ object DayRolloverHandler : BroadcastReceiver() {
9595
Timber.i("day cutoff changed %d -> %d", lastCutoff, currentCutoff)
9696
// we do not want to send a "study queues changes" message initially
9797
if (lastCutoff != null) {
98-
Timber.i("updating study queues")
99-
ChangeManager.notifySubscribers(opChanges { studyQueues = true }, initiator = null)
98+
handleDayRollover()
10099
}
101100
this.lastCutoff = currentCutoff
102101
}
102+
103+
private fun handleDayRollover() {
104+
Timber.i("day rollover occurred")
105+
106+
Timber.i("updating study queues")
107+
ChangeManager.notifySubscribers(opChanges { studyQueues = true }, initiator = null)
108+
}
103109
}

0 commit comments

Comments
 (0)