mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-10 17:58:02 +02:00
Update chapter editor remove redirect on save or delete all #4650
This commit is contained in:
parent
4b840f9c97
commit
85d5531bc1
@ -697,11 +697,7 @@ export default {
|
|||||||
this.saving = false
|
this.saving = false
|
||||||
if (data.updated) {
|
if (data.updated) {
|
||||||
this.$toast.success(this.$strings.ToastChaptersUpdated)
|
this.$toast.success(this.$strings.ToastChaptersUpdated)
|
||||||
if (this.previousRoute) {
|
this.reloadLibraryItem()
|
||||||
this.$router.push(this.previousRoute)
|
|
||||||
} else {
|
|
||||||
this.$router.push(`/item/${this.libraryItem.id}`)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
||||||
}
|
}
|
||||||
@ -874,11 +870,7 @@ export default {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.updated) {
|
if (data.updated) {
|
||||||
this.$toast.success(this.$strings.ToastChaptersRemoved)
|
this.$toast.success(this.$strings.ToastChaptersRemoved)
|
||||||
if (this.previousRoute) {
|
this.reloadLibraryItem()
|
||||||
this.$router.push(this.previousRoute)
|
|
||||||
} else {
|
|
||||||
this.$router.push(`/item/${this.libraryItem.id}`)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
||||||
}
|
}
|
||||||
@ -983,6 +975,18 @@ export default {
|
|||||||
}
|
}
|
||||||
this.libraryItem = libraryItem
|
this.libraryItem = libraryItem
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reloadLibraryItem() {
|
||||||
|
this.$axios
|
||||||
|
.$get(`/api/items/${this.libraryItem.id}?expanded=1`)
|
||||||
|
.then((data) => {
|
||||||
|
this.libraryItem = data
|
||||||
|
this.initChapters()
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed to reload library item', error)
|
||||||
|
this.$toast.error(this.$strings.ToastFailedToLoadData)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
Loading…
Reference in New Issue
Block a user