Added timeout to fetch user totals which prevents

Duplicate calls which would be really annoying
This commit is contained in:
Max
2022-12-22 01:59:27 +00:00
parent 7f65587db6
commit 51e35b0f11
3 changed files with 28 additions and 18 deletions

View File

@@ -227,10 +227,12 @@
},
pinNote(){ //togglePinned() <- old name
this.showWorking = true
let postData = {'pinned': !this.note.pinned, 'noteId':this.note.id}
this.note.pinned = this.note.pinned == 1 ? 0:1
let postData = {'pinned': this.note.pinned, 'noteId':this.note.id}
axios.post('/api/note/setpinned', postData)
.then(data => {
this.showWorking = false
// this event is triggered by the server after note is saved
// this.$bus.$emit('update_single_note', this.note.id)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Pin Note') })
@@ -246,11 +248,10 @@
//Show message so no one worries where note went
let message = 'Moved to Archive'
if(postData.archived != 1){
message = 'Moved to main list'
message = 'Moved out of Archive'
}
this.$bus.$emit('notification', message)
// this.$bus.$emit('update_single_note', this.note.id)
this.$bus.$emit('update_single_note', this.note.id)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Archive Note') })
},
@@ -265,9 +266,10 @@
//Show message so no one worries where note went
let message = 'Moved to Trash'
if(postData.trashed == 0){
message = 'Moved to main list'
message = 'Moved out of Trash'
}
this.$bus.$emit('notification', message)
this.$bus.$emit('update_single_note', this.note.id)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Trash Note') })