Commit b80f341d authored by Cédric Moreau's avatar Cédric Moreau

[enh] Autofocus sur le champ d'authentification si l'option « mémoriser » n'est pas cochée

parent e3ea3b1c
......@@ -8,6 +8,7 @@
<ion-input type="password"
[disabled]="computing"
[(ngModel)]="salt"
#saltinput
placeholder="Tapez votre identifiant secret."></ion-input>
</ion-item>
......
import {Component, OnInit} from "@angular/core";
import {Component, OnInit, ViewChild} from "@angular/core";
import {NavParams, ViewController} from "ionic-angular";
const scrypt = require('scrypt-async')
const tweetnacl = require('tweetnacl')
......@@ -11,6 +11,8 @@ const base58 = require('../../lib/base58')
})
export class AuthModal implements OnInit {
@ViewChild('saltinput') saltInput;
error:string
generated:string
salt:string
......@@ -30,10 +32,17 @@ export class AuthModal implements OnInit {
this.remember = Boolean(sessionStorage.getItem('remember'))
this.noConfirm = Boolean(sessionStorage.getItem('noConfirm'))
}
ngOnInit(): void {
if (this.noConfirm) {
this.valideCle()
}
if (!this.remember) {
setTimeout(() => {
this.saltInput.setFocus();
},150);
}
}
getKeyPair() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment