feat: confirm dialog for changing decks

This commit is contained in:
2025-07-08 14:59:24 +02:00
parent d5a744652d
commit 425660f139

View File

@ -280,6 +280,12 @@
}
function handleDeckChange() {
if (!confirm('Are you sure you want to change the deck? This will reset the current session.')) {
// If the user cancels, revert the selection
const previousDeck = cards.length > 0 ? deckConfigs.findIndex(d => d.cards[0] === cards[0].frontImage) : 0;
selectedDeck = previousDeck;
return;
}
initializeDeck();
}