Commit e7645af
Fix resume recalling button not showing when viewing last answered question
Bug: When recalling and viewing the previously answered question (which is the
last memory tracker), the resume recalling button in the main menu doesn't show.
Root cause: The condition for showing the Resume button was:
(isPausedByCursor || isPausedByIndex) && toRepeatCount > 0
When viewing the last answered question after completing all recall items:
- isRecallPaused (isPausedByCursor) is true
- toRepeatCount = length - currentIndex = 0
The condition failed because toRepeatCount was 0.
Fix: Changed the condition to:
(isPausedByCursor && hasLoadedTrackers) || (isPausedByIndex && toRepeatCount > 0)
This means:
- If viewing a previously answered question (isPausedByCursor), show Resume
button as long as there are memory trackers loaded (even if all answered)
- If navigated away after answering (isPausedByIndex), show Resume button
only if there are remaining items to recall
Added unit test to cover the new scenario.
Co-authored-by: terry <terry@odd-e.com>1 parent 9f3a62c commit e7645af
2 files changed
+26
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
57 | | - | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
| 610 | + | |
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
620 | 632 | | |
621 | 633 | | |
622 | 634 | | |
| |||
0 commit comments