Fix twofaccounts not being selectable in management mode

This commit is contained in:
Bubka 2023-11-20 13:20:09 +01:00
parent 89657bb5aa
commit f473533bfb

View File

@ -132,11 +132,6 @@
* Shows rotating OTP for the provided account * Shows rotating OTP for the provided account
*/ */
function showOTP(account) { function showOTP(account) {
// In Management mode, clicking an account does not show the otpDisplay, it selects the account
if(bus.inManagementMode) {
twofaccounts.select(account.id)
}
else {
// Data that should be displayed quickly by the OtpDisplay // Data that should be displayed quickly by the OtpDisplay
// component are passed using props. // component are passed using props.
otpDisplayProps.value.otp_type = account.otp_type otpDisplayProps.value.otp_type = account.otp_type
@ -149,12 +144,16 @@
otpDisplay.value.show(account.id); otpDisplay.value.show(account.id);
}) })
} }
}
/** /**
* Shows an OTP in a modal or directly copies it to the clipboard * Shows an OTP in a modal or directly copies it to the clipboard
*/ */
function showOrCopy(account) { function showOrCopy(account) {
// In Management mode, clicking an account does not show/copy, it selects the account
if(bus.inManagementMode) {
twofaccounts.select(account.id)
}
else {
if (!user.preferences.getOtpOnRequest && account.otp_type.includes('totp')) { if (!user.preferences.getOtpOnRequest && account.otp_type.includes('totp')) {
copyToClipboard(account.otp.password) copyToClipboard(account.otp.password)
} }
@ -162,6 +161,7 @@
showOTP(account) showOTP(account)
} }
} }
}
/** /**
* Copies a string to the clipboard * Copies a string to the clipboard