* Added error display to every axios server call
* Added better destroy of login token if invalid * Block users from opening notes they don't own, note closes automatically * Beefed up login and home page a little to make them more appealing
This commit is contained in:
@@ -203,6 +203,7 @@
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to delete attachment') })
|
||||
},
|
||||
saveIt(){
|
||||
|
||||
@@ -221,6 +222,7 @@
|
||||
|
||||
//Save it, and don't think about it.
|
||||
axios.post('/api/attachment/update', data)
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Save') })
|
||||
|
||||
},
|
||||
}
|
||||
|
@@ -73,6 +73,7 @@
|
||||
})
|
||||
.catch(results => {
|
||||
this.uploadStatusText = 0
|
||||
this.$bus.$emit('notification', 'Failed to Upload')
|
||||
})
|
||||
},
|
||||
handleFileUpload() {
|
||||
|
@@ -257,7 +257,7 @@
|
||||
},
|
||||
data: function(){
|
||||
return {
|
||||
version: '1.0.2',
|
||||
version: '1.0.3',
|
||||
username: '',
|
||||
collapsed: false,
|
||||
mobile: false,
|
||||
@@ -334,6 +334,7 @@
|
||||
this.disableNewNote = false
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to create note') })
|
||||
},
|
||||
destroyLoginToken() {
|
||||
this.$bus.$emit('notification', 'Logged Out')
|
||||
|
@@ -33,6 +33,7 @@
|
||||
this.$store.dispatch('fetchAndUpdateUserTotals')
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Delete Note') })
|
||||
},
|
||||
reset(){
|
||||
this.click = 0
|
||||
|
@@ -862,6 +862,13 @@
|
||||
axios.post('/api/note/get', { 'noteId': this.noteid, 'password':this.hashedPass })
|
||||
.then(response => {
|
||||
|
||||
//Block notes you don't have access to from opening
|
||||
if(response.data === false){
|
||||
this.$bus.$emit('notification', 'Invalid Note')
|
||||
this.close(true)
|
||||
return
|
||||
}
|
||||
|
||||
//Set up local data
|
||||
this.currentNoteId = this.noteid
|
||||
this.rawTextId = response.data.rawTextId
|
||||
@@ -918,6 +925,7 @@
|
||||
})
|
||||
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Open Note') })
|
||||
} else {
|
||||
console.log('Could not fetch note')
|
||||
}
|
||||
@@ -1155,6 +1163,7 @@
|
||||
this.startAutolockTimer()
|
||||
return resolve(true)
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Save Note') })
|
||||
})
|
||||
},
|
||||
checkForUpdatedNote(){
|
||||
@@ -1183,6 +1192,7 @@
|
||||
this.updated = data.updated
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to get diff') })
|
||||
}
|
||||
|
||||
//Track visibility state
|
||||
@@ -1208,7 +1218,14 @@
|
||||
|
||||
return hash;
|
||||
},
|
||||
close(){
|
||||
close(force = false){
|
||||
|
||||
if(force){
|
||||
this.$bus.$emit('close_active_note', {
|
||||
position: this.position, noteId: this.noteid, modified: this.modified
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.save().then( result => {
|
||||
|
||||
|
@@ -91,6 +91,7 @@
|
||||
this.allTags = data.allTags
|
||||
this.noteTagIds = data.noteTagIds
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Get Tags') })
|
||||
},
|
||||
isTagOnNote(id){
|
||||
for (let i = 0; i < this.noteTagIds.length; i++) {
|
||||
@@ -170,6 +171,7 @@
|
||||
vm.suggestions = response.data
|
||||
vm.selection = -1 //Nothing selected
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Get Suggested Tags') })
|
||||
}
|
||||
}, 300)
|
||||
},
|
||||
@@ -226,6 +228,7 @@
|
||||
//Trigger focus event to reload tag suggestions
|
||||
vm.onFocus()
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Add Tag') })
|
||||
},
|
||||
onFocus(){
|
||||
return
|
||||
@@ -240,6 +243,7 @@
|
||||
vm.suggestions = response.data
|
||||
vm.selection = -1 //Nothing selected
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Fetch Latest Tags') })
|
||||
},
|
||||
onKeyup(){
|
||||
|
||||
@@ -268,6 +272,7 @@
|
||||
.then(response => {
|
||||
this.getTags()
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Remove Tag') })
|
||||
},
|
||||
clearSuggestions(){
|
||||
this.suggestions = []
|
||||
|
@@ -172,6 +172,7 @@
|
||||
.then(data => {
|
||||
this.$bus.$emit('update_single_note', this.note.id)
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Pin Note') })
|
||||
},
|
||||
archiveNote(){ //toggleArchived() <- old name
|
||||
let postData = {'archived': !this.note.archived, 'noteId':this.note.id}
|
||||
@@ -187,6 +188,7 @@
|
||||
|
||||
this.$bus.$emit('update_single_note', this.note.id)
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Archive Note') })
|
||||
},
|
||||
toggleTags(state){
|
||||
|
||||
|
@@ -78,6 +78,7 @@
|
||||
.then( ({data}) => {
|
||||
this.sharedWithUsers = data
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Load Shared') })
|
||||
},
|
||||
onRevokeAccess(noteId){
|
||||
axios.post('/api/note/shareremoveuser', {'noteId':noteId})
|
||||
@@ -87,6 +88,7 @@
|
||||
this.loadShareList()
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Remove Share User') })
|
||||
},
|
||||
onKeyup(event){
|
||||
if(event.keyCode == 13){
|
||||
@@ -105,6 +107,7 @@
|
||||
this.$bus.$emit('notification', 'User not found')
|
||||
}
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Add User') })
|
||||
|
||||
},
|
||||
}
|
||||
|
@@ -100,6 +100,7 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(error => { this.$bus.$emit('notification', 'Failed to Load Attachments') })
|
||||
},
|
||||
methods: {
|
||||
onFileClick(file){
|
||||
|
Reference in New Issue
Block a user