Skip to content

Commit

Permalink
Update:Persist soft/hard delete checkbox option #1689
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Nov 9, 2023
1 parent 33e287a commit d6b1767
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/components/app/Appbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,11 @@ export default {
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
yesButtonText: this.$strings.ButtonDelete,
yesButtonColor: 'error',
checkboxDefaultValue: true,
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
callback: (confirmed, hardDelete) => {
if (confirmed) {
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
this.$store.commit('setProcessingBatch', true)
this.$axios
Expand Down
4 changes: 3 additions & 1 deletion client/components/cards/LazyBookCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,11 @@ export default {
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
yesButtonText: this.$strings.ButtonDelete,
yesButtonColor: 'error',
checkboxDefaultValue: true,
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
callback: (confirmed, hardDelete) => {
if (confirmed) {
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
this.processing = true
const axios = this.$axios || this.$nuxt.$axios
axios
Expand Down
4 changes: 3 additions & 1 deletion client/pages/item/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,11 @@ export default {
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
yesButtonText: this.$strings.ButtonDelete,
yesButtonColor: 'error',
checkboxDefaultValue: true,
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
callback: (confirmed, hardDelete) => {
if (confirmed) {
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
this.$axios
.$delete(`/api/items/${this.libraryItemId}?hard=${hardDelete ? 1 : 0}`)
.then(() => {
Expand Down

0 comments on commit d6b1767

Please sign in to comment.