mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-25 06:24:07 +02:00
Bind twofaccount data to OtpDisplay to prevent display lag
This commit is contained in:
parent
f3350e2dda
commit
21a7bfffa7
@ -36,6 +36,12 @@
|
|||||||
const isRenewingOTPs = ref(false)
|
const isRenewingOTPs = ref(false)
|
||||||
|
|
||||||
const otpDisplay = ref(null)
|
const otpDisplay = ref(null)
|
||||||
|
const otpDisplayProps = ref({
|
||||||
|
otp_type: '',
|
||||||
|
account : '',
|
||||||
|
service : '',
|
||||||
|
icon : '',
|
||||||
|
})
|
||||||
const looperRefs = ref([])
|
const looperRefs = ref([])
|
||||||
const dotsRefs = ref([])
|
const dotsRefs = ref([])
|
||||||
|
|
||||||
@ -126,8 +132,17 @@
|
|||||||
twofaccounts.select(account.id)
|
twofaccounts.select(account.id)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Data that should be displayed quickly by the OtpDisplay
|
||||||
|
// component are passed using props.
|
||||||
|
otpDisplayProps.value.otp_type = account.otp_type
|
||||||
|
otpDisplayProps.value.service = account.service
|
||||||
|
otpDisplayProps.value.account = account.account
|
||||||
|
otpDisplayProps.value.icon = account.icon
|
||||||
|
|
||||||
|
nextTick().then(() => {
|
||||||
showOtpInModal.value = true
|
showOtpInModal.value = true
|
||||||
otpDisplay.value.show(account.id);
|
otpDisplay.value.show(account.id);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +332,7 @@
|
|||||||
<Modal v-model="showOtpInModal">
|
<Modal v-model="showOtpInModal">
|
||||||
<OtpDisplay
|
<OtpDisplay
|
||||||
ref="otpDisplay"
|
ref="otpDisplay"
|
||||||
|
v-bind="otpDisplayProps"
|
||||||
@please-close-me="showOtpInModal = false">
|
@please-close-me="showOtpInModal = false">
|
||||||
</OtpDisplay>
|
</OtpDisplay>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user