Consolidate translations and reduce number of toasts

This commit is contained in:
advplyr 2024-08-30 17:41:58 -05:00
parent 3dfbddda33
commit c273626c3d
18 changed files with 15 additions and 48 deletions

View file

@ -218,7 +218,6 @@ export default {
.$post(`/api/emails/ereader-devices`, payload)
.then((data) => {
this.ereaderDevicesUpdated(data.ereaderDevices)
this.$toast.success(this.$strings.ToastDeviceDeleteSuccess)
})
.catch((error) => {
console.error('Failed to delete device', error)

View file

@ -290,7 +290,6 @@ export default {
this.$axios
.$post(`/api/sessions/batch/delete`, payload)
.then(() => {
this.$toast.success(this.$strings.ToastSessionsRemoved)
if (isAllSessions) {
// If all sessions were removed from the current page then go to the previous page
if (this.currentPage > 0) {
@ -358,12 +357,13 @@ export default {
})
if (!libraryItem) {
this.$toast.error(this.$strings.ToastGetLibraryItemFailed)
this.$toast.error(this.$strings.ToastFailedToLoadData)
this.processingGoToTimestamp = false
return
}
if (session.episodeId && !libraryItem.media.episodes.some((ep) => ep.id === session.episodeId)) {
this.$toast.error(this.$strings.ToastGetPodcastEpisodeFailed)
console.error('Episode not found in library item', session.episodeId, libraryItem.media.episodes)
this.$toast.error(this.$strings.ToastFailedToLoadData)
this.processingGoToTimestamp = false
return
}

View file

@ -127,12 +127,13 @@ export default {
})
if (!libraryItem) {
this.$toast.error(this.$strings.ToastGetLibraryItemFailed)
this.$toast.error(this.$strings.ToastFailedToLoadData)
this.processingGoToTimestamp = false
return
}
if (session.episodeId && !libraryItem.media.episodes.some((ep) => ep.id === session.episodeId)) {
this.$toast.error(this.$strings.ToastGetPodcastEpisodeFailed)
console.error('Episode not found in library item', session.episodeId, libraryItem.media.episodes)
this.$toast.error(this.$strings.ToastFailedToLoadData)
this.processingGoToTimestamp = false
return
}