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

@ -127,7 +127,6 @@ export default {
.$patch(`/api/notifications/${this.notification.id}`, payload)
.then((updatedSettings) => {
this.$emit('update', updatedSettings)
this.$toast.success(this.$strings.ToastNotificationEnabled)
})
.catch((error) => {
console.error('Failed to update notification', error)
@ -155,7 +154,6 @@ export default {
.$delete(`/api/notifications/${this.notification.id}`)
.then((updatedSettings) => {
this.$emit('update', updatedSettings)
this.$toast.success(this.$strings.ToastNotificationDeleteSuccess)
})
.catch((error) => {
console.error('Failed', error)

View file

@ -159,7 +159,7 @@ export default {
})
.catch((error) => {
console.error('Failed to get ffprobe data', error)
this.$toast.error(this.$strings.ToastFfprobeFailed)
this.$toast.error(this.$strings.ToastFailedToLoadData)
})
.finally(() => {
this.probingFile = false

View file

@ -206,7 +206,6 @@ export default {
this.$axios
.$post(`/api/session/${this._session.id}/close`)
.then(() => {
this.$toast.success(this.$strings.ToastSessionCloseSuccess)
this.show = false
this.$emit('closedSession')
})

View file

@ -15,7 +15,7 @@
</template>
<form class="flex items-center justify-center px-6 py-3" @submit.prevent="submitCustomTime">
<ui-text-input v-model="customTime" type="number" step="any" min="0.1" :placeholder="$strings.LabelTimeInMinutes" class="w-48" />
<ui-btn color="success" type="submit" :padding-x="0" class="h-9 w-12 flex items-center justify-center ml-1">{{ $strings.ButtonSet }}</ui-btn>
<ui-btn color="success" type="submit" :padding-x="0" class="h-9 w-18 flex items-center justify-center ml-1">{{ $strings.ButtonSubmit }}</ui-btn>
</form>
</div>
<div v-if="timerSet" class="w-full p-4">

View file

@ -78,7 +78,6 @@ export default {
if (data.error) {
this.$toast.error(data.error)
} else {
this.$toast.success(this.$strings.ToastCoverUploaded)
this.resetCoverPreview()
}
this.processingUpload = false

View file

@ -174,7 +174,6 @@ export default {
.$post(`/api/emails/ereader-devices`, payload)
.then((data) => {
this.$emit('update', data.ereaderDevices)
this.$toast.success(this.$strings.ToastDeviceUpdateSuccess)
this.show = false
})
.catch((error) => {
@ -201,7 +200,6 @@ export default {
.$post('/api/emails/ereader-devices', payload)
.then((data) => {
this.$emit('update', data.ereaderDevices || [])
this.$toast.success(this.$strings.ToastDeviceAddSuccess)
this.show = false
})
.catch((error) => {

View file

@ -194,7 +194,6 @@ export default {
if (data.error) {
this.$toast.error(data.error)
} else {
this.$toast.success(this.$strings.ToastCoverUploaded)
this.resetCoverPreview()
}
this.processingUpload = false
@ -264,7 +263,6 @@ export default {
.$post(`/api/items/${this.libraryItemId}/cover`, { url: cover })
.then(() => {
this.imageUrl = ''
this.$toast.success(this.$strings.ToastCoverUpdateSuccess)
})
.catch((error) => {
console.error('Failed to update cover', error)
@ -308,9 +306,6 @@ export default {
this.isProcessing = true
this.$axios
.$patch(`/api/items/${this.libraryItemId}/cover`, { cover: coverFile.metadata.path })
.then(() => {
this.$toast.success(this.$strings.ToastCoverUpdateSuccess)
})
.catch((error) => {
console.error('Failed to set local cover', error)
this.$toast.error(error.response?.data || this.$strings.ToastCoverUpdateFailed)

View file

@ -162,7 +162,7 @@ export default {
})
.catch((error) => {
console.error('Failed to get filesystem paths', error)
this.$toast.error(this.$strings.ToastGetFilesystemPathsFailed)
this.$toast.error(this.$strings.ToastFailedToLoadData)
return []
})
.finally(() => {

View file

@ -149,7 +149,6 @@ export default {
.$post('/api/notifications', payload)
.then((updatedSettings) => {
this.$emit('update', updatedSettings)
this.$toast.success(this.$strings.ToastNotificationCreateSuccess)
this.show = false
})
.catch((error) => {