Add button to save without cropping
This commit is contained in:
parent
96f9eab700
commit
3108722eda
4 changed files with 32 additions and 2 deletions
|
@ -158,7 +158,13 @@ const UserSettings = {
|
|||
reader.readAsDataURL(file)
|
||||
},
|
||||
submitAvatar (cropper, file) {
|
||||
const img = cropper.getCroppedCanvas().toDataURL(file.type)
|
||||
let img
|
||||
if (cropper) {
|
||||
img = cropper.getCroppedCanvas().toDataURL(file.type)
|
||||
} else {
|
||||
img = file
|
||||
}
|
||||
|
||||
return this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
|
||||
if (!user.error) {
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue