Improve UX of account page

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-06-30 09:06:59 +02:00
parent 0e426a547b
commit 2f88ab2ebc
2 changed files with 6 additions and 7 deletions

View file

@ -43,9 +43,11 @@
v-model="confirmPassword"
></v-text-field>
</v-flex>
<v-flex xs12 text-xs-left class="px-2 pt-4 pb-2">
<v-btn depressed dark color="secondary-dark" @click.stop="confirm"
class="action-confirm ma-0" :disabled="busy">
<v-flex xs12 class="px-2 pt-4 pb-2">
<v-btn depressed color="secondary-dark"
@click.stop="confirm"
:disabled="disabled()"
class="action-confirm white--text ma-0">
<translate>Change Password</translate>
<v-icon right dark>vpn_key</v-icon>
</v-btn>
@ -71,7 +73,7 @@
},
methods: {
disabled() {
return (this.oldPassword === "" || this.newPassword === "" || (this.newPassword !== this.confirmPassword));
return (this.busy || this.oldPassword === "" || this.newPassword === "" || (this.newPassword !== this.confirmPassword));
},
confirm() {
this.busy = true;

View file

@ -3,7 +3,6 @@ package entity
import (
"time"
"github.com/photoprism/photoprism/pkg/txt"
"golang.org/x/crypto/bcrypt"
)
@ -68,8 +67,6 @@ func FindPassword(uid string) *Password {
if err := Db().Where("uid = ?", uid).First(&result).Error; err == nil {
return &result
} else {
log.Errorf("auth: no password for %s", txt.Quote(uid))
}
return nil