mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-06 02:37:21 +03:00
small refactor
open add new cred dialog is now a function
This commit is contained in:
parent
7d9ceb70ae
commit
146d55b838
20
qml/Main.qml
20
qml/Main.qml
@ -44,15 +44,7 @@ ApplicationWindow {
|
||||
menuBar: MainMenuBar {
|
||||
slotMode: settings.slotMode
|
||||
hasDevice: device.hasDevice
|
||||
onOpenAddCredential: {
|
||||
if (settings.slotMode) {
|
||||
addCredentialSlot.clear()
|
||||
device.getSlotStatus(addCredentialSlot.open)
|
||||
} else {
|
||||
addCredential.clear()
|
||||
addCredential.open()
|
||||
}
|
||||
}
|
||||
onOpenAddCredential: openClearAddCredential()
|
||||
onOpenSetPassword: setPassword.open()
|
||||
onOpenReset: reset.open()
|
||||
onOpenSettings: settingsDialog.open()
|
||||
@ -559,4 +551,14 @@ ApplicationWindow {
|
||||
function getDigits(slot) {
|
||||
return getSlotDigitsSettings()[slot - 1]
|
||||
}
|
||||
|
||||
function openClearAddCredential() {
|
||||
if (settings.slotMode) {
|
||||
addCredentialSlot.clear()
|
||||
device.getSlotStatus(addCredentialSlot.open)
|
||||
} else {
|
||||
addCredential.clear()
|
||||
addCredential.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user