From 300d050460ebf638870fb40fd597167a5d2dda03 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Thu, 5 Jun 2025 23:14:24 +0100 Subject: [PATCH] Show message on pass --- ftl/core/deck-config.ftl | 1 + ts/routes/deck-options/FsrsOptions.svelte | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index f3445f4c6..8158155e3 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -493,6 +493,7 @@ deck-config-fsrs-bad-fit-warning = Your memory is difficult for FSRS to predict. - Understand before you memorize. After you follow these suggestions, it may take weeks or months before parameters become optimal. +deck-config-fsrs-good-fit = FSRS is well adjusted to your memory. deck-config-fsrs-params-no-reviews = No reviews found. Make sure this preset is assigned to all decks (including subdecks) that you want to optimize, and try again. diff --git a/ts/routes/deck-options/FsrsOptions.svelte b/ts/routes/deck-options/FsrsOptions.svelte index d06c09eb5..9c6c88559 100644 --- a/ts/routes/deck-options/FsrsOptions.svelte +++ b/ts/routes/deck-options/FsrsOptions.svelte @@ -190,12 +190,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html )) || resp.params.length === 0; - const health_check_passed = - resp.healthCheckPassed && !resp.healthCheckPassed; - - if (health_check_passed) { - setTimeout(() => alert(tr.deckConfigFsrsBadFitWarning())); - } else if (already_optimal) { + if (resp.healthCheckPassed !== undefined) { + if (resp.healthCheckPassed) { + setTimeout( + () => alert(tr.deckConfigFsrsGoodFit()), + 200, + ); + } else { + setTimeout( + () => alert(tr.deckConfigFsrsBadFitWarning()), + 200, + ); + } + } + else if (already_optimal) { const msg = resp.fsrsItems ? tr.deckConfigFsrsParamsOptimal() : tr.deckConfigFsrsParamsNoReviews();