mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-13 01:19:55 +02:00
Update remove playlist translations and use our custom confirm modal
This commit is contained in:
parent
394bf8cb70
commit
7f8de7915c
@ -74,21 +74,32 @@ export default {
|
|||||||
this.newPlaylistDescription = this.playlist.description || ''
|
this.newPlaylistDescription = this.playlist.description || ''
|
||||||
},
|
},
|
||||||
removeClick() {
|
removeClick() {
|
||||||
if (confirm(this.$getString('MessageConfirmRemovePlaylist', [this.playlistName]))) {
|
const payload = {
|
||||||
this.processing = true
|
message: this.$getString('MessageConfirmRemovePlaylist', [this.playlistName]),
|
||||||
this.$axios
|
callback: (confirmed) => {
|
||||||
.$delete(`/api/playlists/${this.playlist.id}`)
|
if (confirmed) {
|
||||||
.then(() => {
|
this.removePlaylist()
|
||||||
this.processing = false
|
}
|
||||||
this.show = false
|
},
|
||||||
this.$toast.success(this.$strings.ToastPlaylistRemoveSuccess)
|
type: 'yesNo'
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('Failed to remove playlist', error)
|
|
||||||
this.processing = false
|
|
||||||
this.$toast.error(this.$strings.ToastRemoveFailed)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||||
|
},
|
||||||
|
removePlaylist() {
|
||||||
|
this.processing = true
|
||||||
|
this.$axios
|
||||||
|
.$delete(`/api/playlists/${this.playlist.id}`)
|
||||||
|
.then(() => {
|
||||||
|
this.show = false
|
||||||
|
this.$toast.success(this.$strings.ToastPlaylistRemoveSuccess)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed to remove playlist', error)
|
||||||
|
this.$toast.error(this.$strings.ToastRemoveFailed)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.processing = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
if (this.newPlaylistName === this.playlistName && this.newPlaylistDescription === this.playlist.description) {
|
if (this.newPlaylistName === this.playlistName && this.newPlaylistDescription === this.playlist.description) {
|
||||||
|
@ -109,21 +109,31 @@ export default {
|
|||||||
this.$store.commit('globals/setEditPlaylist', this.playlist)
|
this.$store.commit('globals/setEditPlaylist', this.playlist)
|
||||||
},
|
},
|
||||||
removeClick() {
|
removeClick() {
|
||||||
if (confirm(`Are you sure you want to remove playlist "${this.playlistName}"?`)) {
|
const payload = {
|
||||||
this.processingRemove = true
|
message: this.$getString('MessageConfirmRemovePlaylist', [this.playlistName]),
|
||||||
var playlistName = this.playlistName
|
callback: (confirmed) => {
|
||||||
this.$axios
|
if (confirmed) {
|
||||||
.$delete(`/api/playlists/${this.playlist.id}`)
|
this.removePlaylist()
|
||||||
.then(() => {
|
}
|
||||||
this.processingRemove = false
|
},
|
||||||
this.$toast.success(`Playlist "${playlistName}" Removed`)
|
type: 'yesNo'
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('Failed to remove playlist', error)
|
|
||||||
this.processingRemove = false
|
|
||||||
this.$toast.error(`Failed to remove playlist`)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||||
|
},
|
||||||
|
removePlaylist() {
|
||||||
|
this.processingRemove = true
|
||||||
|
this.$axios
|
||||||
|
.$delete(`/api/playlists/${this.playlist.id}`)
|
||||||
|
.then(() => {
|
||||||
|
this.$toast.success(this.$strings.ToastPlaylistRemoveSuccess)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed to remove playlist', error)
|
||||||
|
this.$toast.error(this.$strings.ToastRemoveFailed)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.processingRemove = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
clickPlay() {
|
clickPlay() {
|
||||||
const queueItems = []
|
const queueItems = []
|
||||||
|
Loading…
Reference in New Issue
Block a user