Update browser confirm prompts to use confirm prompt modal instead

This commit is contained in:
advplyr 2025-02-24 17:44:17 -06:00
parent c7d8021a16
commit b0045b5b8b
5 changed files with 129 additions and 73 deletions

View file

@ -599,19 +599,31 @@ export default {
},
clearProgressClick() {
if (!this.userMediaProgress) return
if (confirm(this.$strings.MessageConfirmResetProgress)) {
this.resettingProgress = true
this.$axios
.$delete(`/api/me/progress/${this.userMediaProgress.id}`)
.then(() => {
console.log('Progress reset complete')
this.resettingProgress = false
})
.catch((error) => {
console.error('Progress reset failed', error)
this.resettingProgress = false
})
const payload = {
message: this.$strings.MessageConfirmResetProgress,
callback: (confirmed) => {
if (confirmed) {
this.clearProgress()
}
},
type: 'yesNo'
}
this.$store.commit('globals/setConfirmPrompt', payload)
},
clearProgress() {
this.resettingProgress = true
this.$axios
.$delete(`/api/me/progress/${this.userMediaProgress.id}`)
.then(() => {
console.log('Progress reset complete')
})
.catch((error) => {
console.error('Progress reset failed', error)
})
.finally(() => {
this.resettingProgress = false
})
},
clickRSSFeed() {
this.$store.commit('globals/setRSSFeedOpenCloseModal', {