mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix/Invalid memory states in simulator after parameters changed (#4317)
* Fix/Invalid memory states after optimization for simulator * Update ts/routes/deck-options/FsrsOptions.svelte * typo * ./check
This commit is contained in:
parent
08431106da
commit
dda730dfa2
2 changed files with 12 additions and 2 deletions
|
@ -498,6 +498,7 @@ deck-config-desired-retention-below-optimal = Your desired retention is below op
|
|||
# cards that can be recalled or retrieved on a specific date.
|
||||
deck-config-fsrs-simulator-experimental = FSRS Simulator (Experimental)
|
||||
deck-config-fsrs-simulate-desired-retention-experimental = FSRS Desired Retention Simulator (Experimental)
|
||||
deck-config-fsrs-simulate-save-preset = After optimizing, please save your config before running the simulator.
|
||||
deck-config-fsrs-desired-retention-help-me-decide-experimental = Help Me Decide (Experimental)
|
||||
deck-config-additional-new-cards-to-simulate = Additional new cards to simulate
|
||||
deck-config-simulate = Simulate
|
||||
|
|
|
@ -53,6 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
let desiredRetentionFocused = false;
|
||||
let desiredRetentionEverFocused = false;
|
||||
let optimized = false;
|
||||
const initialParams = [...fsrsParams($config)];
|
||||
$: if (desiredRetentionFocused) {
|
||||
desiredRetentionEverFocused = true;
|
||||
}
|
||||
|
@ -338,6 +339,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
state.save(UpdateDeckConfigsMode.COMPUTE_ALL_PARAMS);
|
||||
}
|
||||
|
||||
function showSimulatorModal(modal: Modal) {
|
||||
if (fsrsParams($config).toString() === initialParams.toString()) {
|
||||
modal?.show();
|
||||
} else {
|
||||
alert(tr.deckConfigFsrsSimulateSavePreset());
|
||||
}
|
||||
}
|
||||
|
||||
let simulatorModal: Modal;
|
||||
let workloadModal: Modal;
|
||||
</script>
|
||||
|
@ -368,7 +377,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
class="btn btn-primary"
|
||||
on:click={() => {
|
||||
simulateFsrsRequest.reviewLimit = 9999;
|
||||
workloadModal?.show();
|
||||
showSimulatorModal(workloadModal);
|
||||
}}
|
||||
>
|
||||
{tr.deckConfigFsrsDesiredRetentionHelpMeDecideExperimental()}
|
||||
|
@ -455,7 +464,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<hr />
|
||||
|
||||
<div class="m-1">
|
||||
<button class="btn btn-primary" on:click={() => simulatorModal?.show()}>
|
||||
<button class="btn btn-primary" on:click={() => showSimulatorModal(simulatorModal)}>
|
||||
{tr.deckConfigFsrsSimulatorExperimental()}
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue