status-desktop/ui/onboarding/ExistingKey.qml

52 lines
1.2 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
2020-06-12 20:47:44 +00:00
Item {
property var onClosed: function () {}
id: existingKeyView
anchors.fill: parent
2020-06-12 20:47:44 +00:00
Component.onCompleted: {
enterSeedPhraseModal.open()
}
2020-06-12 20:47:44 +00:00
EnterSeedPhraseModal {
property bool wentNext: false
id: enterSeedPhraseModal
onConfirmSeedClick: function (mnemonic) {
let error = onboardingModel.validateMnemonic(mnemonic)
if (error != "") {
invalidSeedPhraseModal.error = error
invalidSeedPhraseModal.open()
} else {
wentNext = true
enterSeedPhraseModal.close()
onboardingModel.importMnemonic(mnemonic)
createPasswordModal.open()
}
}
2020-06-12 20:47:44 +00:00
onClosed: function () {
if (!wentNext) {
existingKeyView.onClosed()
}
}
}
2020-06-12 20:47:44 +00:00
CreatePasswordModal {
id: createPasswordModal
onClosed: function () {
existingKeyView.onClosed()
}
}
InvalidSeedPhraseModal {
id: invalidSeedPhraseModal
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/