mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-21 11:59:28 +00:00
b3f8af8e06
Qml code referring to the old code base commented out, but not deleted, due to easier refactoring the rest of the app.
116 lines
2.5 KiB
QML
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()
|
|
// }
|
|
|
|
// }
|
|
}
|