Replace: toasts in BookShelfToolbar

This commit is contained in:
Nicholas Wallace 2024-08-28 20:09:57 -07:00
parent acace5fc48
commit 93a0d471da
2 changed files with 10 additions and 5 deletions

View file

@ -473,11 +473,11 @@ export default {
this.$axios this.$axios
.$get(`/api/me/series/${this.seriesId}/readd-to-continue-listening`) .$get(`/api/me/series/${this.seriesId}/readd-to-continue-listening`)
.then(() => { .then(() => {
this.$toast.success('Series re-added to continue listening') this.$toast.success(this.$strings.ToastItemUpdateSuccess)
}) })
.catch((error) => { .catch((error) => {
console.error('Failed to re-add series to continue listening', error) console.error('Failed to re-add series to continue listening', error)
this.$toast.error('Failed to re-add series to continue listening') this.$toast.error(this.$strings.ToastItemUpdateFailed)
}) })
.finally(() => { .finally(() => {
this.processingSeries = false this.processingSeries = false
@ -504,7 +504,7 @@ export default {
}) })
if (!response) { if (!response) {
console.error(`Author ${author.name} not found`) console.error(`Author ${author.name} not found`)
this.$toast.error(`Author ${author.name} not found`) this.$toast.error(this.$getString('ToastAuthorNotFound', [author.name]))
} else if (response.updated) { } else if (response.updated) {
if (response.author.imagePath) console.log(`Author ${response.author.name} was updated`) if (response.author.imagePath) console.log(`Author ${response.author.name} was updated`)
else console.log(`Author ${response.author.name} was updated (no image found)`) else console.log(`Author ${response.author.name} was updated (no image found)`)
@ -522,13 +522,13 @@ export default {
this.$axios this.$axios
.$delete(`/api/libraries/${this.currentLibraryId}/issues`) .$delete(`/api/libraries/${this.currentLibraryId}/issues`)
.then(() => { .then(() => {
this.$toast.success('Removed library items with issues') this.$toast.success(this.$strings.ToastRemoveItemsWithIssuesSuccess)
this.$router.push(`/library/${this.currentLibraryId}/bookshelf`) this.$router.push(`/library/${this.currentLibraryId}/bookshelf`)
this.$store.dispatch('libraries/fetch', this.currentLibraryId) this.$store.dispatch('libraries/fetch', this.currentLibraryId)
}) })
.catch((error) => { .catch((error) => {
console.error('Failed to remove library items with issues', error) console.error('Failed to remove library items with issues', error)
this.$toast.error('Failed to remove library items with issues') this.$toast.error(this.$strings.ToastRemoveItemsWithIssuesFailed)
}) })
.finally(() => { .finally(() => {
this.processingIssues = false this.processingIssues = false

View file

@ -809,6 +809,7 @@
"ToastApiCallFailed": "API call failed", "ToastApiCallFailed": "API call failed",
"ToastAuthorImageRemoveFailed": "Failed to remove image", "ToastAuthorImageRemoveFailed": "Failed to remove image",
"ToastAuthorImageRemoveSuccess": "Author image removed", "ToastAuthorImageRemoveSuccess": "Author image removed",
"ToastAuthorNotFound": "Author {0} not found",
"ToastAuthorUpdateFailed": "Failed to update author", "ToastAuthorUpdateFailed": "Failed to update author",
"ToastAuthorUpdateMerged": "Author merged", "ToastAuthorUpdateMerged": "Author merged",
"ToastAuthorUpdateSuccess": "Author updated", "ToastAuthorUpdateSuccess": "Author updated",
@ -862,6 +863,8 @@
"ToastItemMarkedAsFinishedSuccess": "Item marked as Finished", "ToastItemMarkedAsFinishedSuccess": "Item marked as Finished",
"ToastItemMarkedAsNotFinishedFailed": "Failed to mark as Not Finished", "ToastItemMarkedAsNotFinishedFailed": "Failed to mark as Not Finished",
"ToastItemMarkedAsNotFinishedSuccess": "Item marked as Not Finished", "ToastItemMarkedAsNotFinishedSuccess": "Item marked as Not Finished",
"ToastItemUpdateFailed": "Failed to update item",
"ToastItemUpdateSuccess": "Item updated",
"ToastLibraryCreateFailed": "Failed to create library", "ToastLibraryCreateFailed": "Failed to create library",
"ToastLibraryCreateSuccess": "Library \"{0}\" created", "ToastLibraryCreateSuccess": "Library \"{0}\" created",
"ToastLibraryDeleteFailed": "Failed to delete library", "ToastLibraryDeleteFailed": "Failed to delete library",
@ -890,6 +893,8 @@
"ToastProgressReset": "Your progress was reset", "ToastProgressReset": "Your progress was reset",
"ToastRSSFeedCloseFailed": "Failed to close RSS feed", "ToastRSSFeedCloseFailed": "Failed to close RSS feed",
"ToastRSSFeedCloseSuccess": "RSS feed closed", "ToastRSSFeedCloseSuccess": "RSS feed closed",
"ToastRemoveItemsWithIssuesFailed": "Failed to remove library items with issues",
"ToastRemoveItemsWithIssuesSuccess": "Removed library items with issues",
"ToastRemoveItemFromCollectionFailed": "Failed to remove item from collection", "ToastRemoveItemFromCollectionFailed": "Failed to remove item from collection",
"ToastRemoveItemFromCollectionSuccess": "Item removed from collection", "ToastRemoveItemFromCollectionSuccess": "Item removed from collection",
"ToastRescanFailed": "Re-Scan Failed for \"{0}\"", "ToastRescanFailed": "Re-Scan Failed for \"{0}\"",