Switch to using the websocket for confirmation of batch updates, allowing the main request to be done asynchronously

This commit is contained in:
Nick Thomson 2022-09-24 22:17:36 +01:00
parent 2d6f9bab8b
commit 3e7a76574b
3 changed files with 26 additions and 14 deletions

View file

@ -359,6 +359,18 @@ export default {
// Force refresh
location.reload()
},
batchQuickMatchComplete(result) {
var success = result.success || false
var toast = 'Batch quick match complete!\n' + result.updates + ' Updated'
if (result.unmatched && (result.unmatched > 0)) {
toast += '\n' + result.unmatched + ' with no matches'
}
if (success) {
this.$toast.success(toast)
} else {
this.$toast.info(toast)
}
},
initializeSocket() {
this.socket = this.$nuxtSocket({
name: process.env.NODE_ENV === 'development' ? 'dev' : 'prod',
@ -430,6 +442,8 @@ export default {
this.socket.on('rss_feed_closed', this.rssFeedClosed)
this.socket.on('backup_applied', this.backupApplied)
this.socket.on('batch_quickmatch_complete', this.batchQuickMatchComplete)
},
showUpdateToast(versionData) {
var ignoreVersion = localStorage.getItem('ignoreVersion')