Started captcha and better avatar control, improved login form to fit register link better.

This commit is contained in:
Shpuld Shpuldson 2017-04-21 18:52:42 +03:00
parent b3b6d43dcc
commit 143aa3b990
4 changed files with 84 additions and 12 deletions

View file

@ -7,7 +7,8 @@ const settings = {
hideAttachmentsLocal: this.$store.state.config.hideAttachments,
hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv,
hideNsfwLocal: this.$store.state.config.hideNsfw,
muteWordsString: this.$store.state.config.muteWords.join('\n')
muteWordsString: this.$store.state.config.muteWords.join('\n'),
previewfile: null
}
},
components: {
@ -25,15 +26,26 @@ const settings = {
const reader = new FileReader()
reader.onload = ({target}) => {
const img = target.result
this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => {
this.previewfile = img
/*this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
}
})
})*/
}
reader.readAsDataURL(file)
},
submitAvatar () {
if (!this.previewfile)
return
const img = this.previewfile
this.$store.state.api.backendInteractor.updateAvatar({params: {img}}).then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
}
})
}
},
watch: {