mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
alert when the resp.weights is empty (#3061)
* alert when the resp.weights is empty * format
This commit is contained in:
parent
6ac60f8032
commit
f2acf40221
3 changed files with 8 additions and 9 deletions
|
@ -346,10 +346,8 @@ impl Collection {
|
|||
&config.inner.fsrs_weights,
|
||||
) {
|
||||
Ok(weights) => {
|
||||
if weights.fsrs_items >= 1000 {
|
||||
println!("{}: {:?}", config.name, weights.weights);
|
||||
config.inner.fsrs_weights = weights.weights;
|
||||
}
|
||||
println!("{}: {:?}", config.name, weights.weights);
|
||||
config.inner.fsrs_weights = weights.weights;
|
||||
}
|
||||
Err(AnkiError::Interrupted) => return Err(AnkiError::Interrupted),
|
||||
Err(err) => {
|
||||
|
|
|
@ -96,7 +96,7 @@ impl Collection {
|
|||
let mut weights =
|
||||
fsrs.compute_parameters(items.clone(), fsrs_items < 1000, Some(progress2))?;
|
||||
let metrics = fsrs.universal_metrics(items, &weights, |_| true)?;
|
||||
if metrics.0 < metrics.1 {
|
||||
if metrics.0 <= metrics.1 {
|
||||
weights = current_weights.to_vec();
|
||||
}
|
||||
|
||||
|
|
|
@ -117,10 +117,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
currentWeights: $config.fsrsWeights,
|
||||
});
|
||||
if (
|
||||
$config.fsrsWeights.length &&
|
||||
$config.fsrsWeights.every(
|
||||
(n, i) => n.toFixed(4) === resp.weights[i].toFixed(4),
|
||||
)
|
||||
($config.fsrsWeights.length &&
|
||||
$config.fsrsWeights.every(
|
||||
(n, i) => n.toFixed(4) === resp.weights[i].toFixed(4),
|
||||
)) ||
|
||||
resp.weights.length === 0
|
||||
) {
|
||||
alert(tr.deckConfigFsrsParamsOptimal());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue