mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-17 18:40:59 +02:00
Update:Persist soft/hard delete checkbox option #1689
This commit is contained in:
@@ -320,9 +320,11 @@ export default {
|
|||||||
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
||||||
yesButtonText: this.$strings.ButtonDelete,
|
yesButtonText: this.$strings.ButtonDelete,
|
||||||
yesButtonColor: 'error',
|
yesButtonColor: 'error',
|
||||||
checkboxDefaultValue: true,
|
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
|
||||||
callback: (confirmed, hardDelete) => {
|
callback: (confirmed, hardDelete) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
|
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
|
||||||
|
|
||||||
this.$store.commit('setProcessingBatch', true)
|
this.$store.commit('setProcessingBatch', true)
|
||||||
|
|
||||||
this.$axios
|
this.$axios
|
||||||
|
@@ -848,9 +848,11 @@ export default {
|
|||||||
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
||||||
yesButtonText: this.$strings.ButtonDelete,
|
yesButtonText: this.$strings.ButtonDelete,
|
||||||
yesButtonColor: 'error',
|
yesButtonColor: 'error',
|
||||||
checkboxDefaultValue: true,
|
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
|
||||||
callback: (confirmed, hardDelete) => {
|
callback: (confirmed, hardDelete) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
|
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
|
||||||
|
|
||||||
this.processing = true
|
this.processing = true
|
||||||
const axios = this.$axios || this.$nuxt.$axios
|
const axios = this.$axios || this.$nuxt.$axios
|
||||||
axios
|
axios
|
||||||
|
@@ -686,9 +686,11 @@ export default {
|
|||||||
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
checkboxLabel: this.$strings.LabelDeleteFromFileSystemCheckbox,
|
||||||
yesButtonText: this.$strings.ButtonDelete,
|
yesButtonText: this.$strings.ButtonDelete,
|
||||||
yesButtonColor: 'error',
|
yesButtonColor: 'error',
|
||||||
checkboxDefaultValue: true,
|
checkboxDefaultValue: !Number(localStorage.getItem('softDeleteDefault') || 0),
|
||||||
callback: (confirmed, hardDelete) => {
|
callback: (confirmed, hardDelete) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
|
localStorage.setItem('softDeleteDefault', hardDelete ? 0 : 1)
|
||||||
|
|
||||||
this.$axios
|
this.$axios
|
||||||
.$delete(`/api/items/${this.libraryItemId}?hard=${hardDelete ? 1 : 0}`)
|
.$delete(`/api/items/${this.libraryItemId}?hard=${hardDelete ? 1 : 0}`)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
Reference in New Issue
Block a user