status-desktop/ui/app/AppLayouts/Onboarding/views/KeycardFlowSelectionView.qml
Sale Djenic b3f8af8e06 refactor(@desktop/general): qml code referring to the old code base commented out
Qml code referring to the old code base commented out, but not deleted,
due to easier refactoring the rest of the app.
2022-02-01 11:42:42 +01:00

116 lines
2.5 KiB
QML

import QtQuick 2.13
import shared.keycard 1.0
import "../popups"
import "../stores"
Item {
enum OnboardingFlow {
Recover,
Generate,
ImportMnemonic
}
property var onClosed: function () {}
property bool connected: false
property int flow: OnboardingFlow.Recover
id: keycardView
Component.onCompleted: {
insertCard.open()
KeycardStore.startConnection()
}
KeycardCreatePINModal {
id: createPinModal
onSubmitBtnClicked: KeycardStore.init(pin)
onClosed: function () {
if (!createPinModal.submitted) {
keycardView.onClosed()
}
}
}
PairingModal {
id: pairingModal
onClosed: function () {
if (!pairingModal.submitted) {
keycardView.onClosed()
}
}
}
PINModal {
id: pinModal
onClosed: function () {
if (!pinModal.submitted) {
keycardView.onClosed()
}
}
}
InsertCard {
id: insertCard
onCancel: function() {
keycardView.onClosed()
}
}
// Not Refactored Yet
// Connections {
// id: connection
// target: OnboardingStore.keycardModelInst
// ignoreUnknownSignals: true
// onCardUnpaired: {
// pairingModal.open()
// }
// onCardPaired: {
// pinModal.open()
// }
// onCardAuthenticated: {
// switch (flow) {
// case OnboardingFlow.Recover: {
// KeycardStore.recoverAccount();
// break;
// }
// case OnboardingFlow.Generate: {
// break;
// }
// case OnboardingFlow.ImportMnemonic: {
// break;
// }
// }
// }
// //TODO: support the states below
// onCardPreInit: {
// createPinModal.open()
// }
// onCardFrozen: {
// keycardView.onClosed()
// }
// onCardBlocked: {
// keycardView.onClosed()
// }
// // TODO: handle these by showing an error an prompting for another card
// // later add factory reset option for the NoFreeSlots case
// onCardNoFreeSlots: {
// keycardView.onClosed()
// }
// onCardNotKeycard: {
// keycardView.onClosed()
// }
// }
}