Skip to content

Commit

Permalink
Delete Note Bug Fixed on Reviewer (ankidroid#14467)
Browse files Browse the repository at this point in the history
* Delete Note Bug Fixed on Reviewer

* Delete Note Bug Fixed on Reviewer

* Delete Note Bug Fixed on Reviewer- Snackbar correction
  • Loading branch information
soCallmeAdityaKumar authored Sep 26, 2023
1 parent d237b71 commit 777bda1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,14 @@ abstract class AbstractFlashcardViewer :
private fun deleteNoteWithoutConfirmation() {
val cardId = currentCard!!.id
launchCatchingTask {
withProgress() {
val noteCount = withProgress() {
undoableOp {
removeNotes(cids = listOf(cardId))
}
}.count
}
val deletedMessage = resources.getQuantityString(R.plurals.card_browser_cards_deleted, noteCount, noteCount)
showSnackbar(deletedMessage, Snackbar.LENGTH_LONG) {
setAction(R.string.undo) { launchCatchingTask { undoAndShowSnackbar() } }
}
}
}
Expand Down

0 comments on commit 777bda1

Please sign in to comment.