Prevent OTP display latency when opening modal

This commit is contained in:
Bubka 2020-01-23 20:51:55 +01:00
parent 7ded76c92e
commit ad18021019
2 changed files with 5 additions and 7 deletions

View File

@ -33,13 +33,14 @@
this.id = id this.id = id
axios.get('api/twofaccounts/' + this.id) axios.get('api/twofaccounts/' + this.id)
.then(response => { .then(async (response) => {
this.service = response.data.service this.service = response.data.service
this.account = response.data.account this.account = response.data.account
this.icon = response.data.icon this.icon = response.data.icon
this.getOTP() await this.getOTP()
this.$parent.isActive = true
}) })
.catch(error => { .catch(error => {
this.$router.push({ name: 'genericError', params: { err: error.response } }); this.$router.push({ name: 'genericError', params: { err: error.response } });

View File

@ -137,18 +137,15 @@
}, },
methods: { methods: {
async showAccount(id) { showAccount(id) {
if( id ) { if( id ) {
await this.$refs.TwofaccountShow.getAccount(id) this.$refs.TwofaccountShow.getAccount(id)
} }
else { else {
let err = new Error("Id missing") let err = new Error("Id missing")
this.$router.push({ name: 'genericError', params: { err: err } }); this.$router.push({ name: 'genericError', params: { err: err } });
} }
this.ShowTwofaccountInModal = true
}, },
deleteAccount: function (id) { deleteAccount: function (id) {