Feat/Confirmation box for save options to preset (#4172)

This commit is contained in:
Luc Mcgrady 2025-07-07 09:10:24 +01:00 committed by GitHub
parent f927aa5788
commit b16439fc9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 13 deletions

View file

@ -514,6 +514,7 @@ deck-config-advanced-settings = Advanced Settings
deck-config-smooth-graph = Smooth graph deck-config-smooth-graph = Smooth graph
deck-config-suspend-leeches = Suspend leeches deck-config-suspend-leeches = Suspend leeches
deck-config-save-options-to-preset = Save Changes to Preset deck-config-save-options-to-preset = Save Changes to Preset
deck-config-save-options-to-preset-confirm = Overwrite the options in your current preset with the options that are currently set in the simulator?
# Radio button in the FSRS simulation diagram (Deck options -> FSRS) selecting # Radio button in the FSRS simulation diagram (Deck options -> FSRS) selecting
# to show the total number of cards that can be recalled or retrieved on a # to show the total number of cards that can be recalled or retrieved on a
# specific date. # specific date.

View file

@ -447,19 +447,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
class="btn {computing ? 'btn-warning' : 'btn-primary'}" class="btn {computing ? 'btn-warning' : 'btn-primary'}"
disabled={computing} disabled={computing}
on:click={() => { on:click={() => {
$config.newPerDay = simulateFsrsRequest.newLimit; if (confirm(tr.deckConfigSaveOptionsToPresetConfirm())) {
$config.reviewsPerDay = simulateFsrsRequest.reviewLimit; $config.newPerDay = simulateFsrsRequest.newLimit;
$config.maximumReviewInterval = simulateFsrsRequest.maxInterval; $config.reviewsPerDay = simulateFsrsRequest.reviewLimit;
$config.desiredRetention = simulateFsrsRequest.desiredRetention; $config.maximumReviewInterval =
$newCardsIgnoreReviewLimit = simulateFsrsRequest.maxInterval;
simulateFsrsRequest.newCardsIgnoreReviewLimit; $config.desiredRetention =
$config.reviewOrder = simulateFsrsRequest.reviewOrder; simulateFsrsRequest.desiredRetention;
$config.leechAction = suspendLeeches $newCardsIgnoreReviewLimit =
? DeckConfig_Config_LeechAction.SUSPEND simulateFsrsRequest.newCardsIgnoreReviewLimit;
: DeckConfig_Config_LeechAction.TAG_ONLY; $config.reviewOrder = simulateFsrsRequest.reviewOrder;
$config.leechThreshold = leechThreshold; $config.leechAction = suspendLeeches
$config.easyDaysPercentages = [...easyDayPercentages]; ? DeckConfig_Config_LeechAction.SUSPEND
onPresetChange(); : DeckConfig_Config_LeechAction.TAG_ONLY;
$config.leechThreshold = leechThreshold;
$config.easyDaysPercentages = [...easyDayPercentages];
onPresetChange();
}
}} }}
> >
{tr.deckConfigSaveOptionsToPreset()} {tr.deckConfigSaveOptionsToPreset()}