mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-26 06:21:15 +00:00
d35344834e
Fixes #5029
75 lines
2.1 KiB
QML
75 lines
2.1 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
import QtQuick.Dialogs 1.3
|
|
|
|
import utils 1.0
|
|
|
|
import "../popups"
|
|
import "../stores"
|
|
import "../shared"
|
|
|
|
Item {
|
|
property var onClosed: function () {}
|
|
|
|
signal showCreatePasswordView()
|
|
|
|
id: existingKeyView
|
|
anchors.fill: parent
|
|
|
|
Component.onCompleted: {
|
|
enterSeedPhraseModal.open()
|
|
}
|
|
|
|
Connections {
|
|
target: onboardingModule
|
|
onAccountImportError: {
|
|
if (error === Constants.existingAccountError) {
|
|
importSeedError.title = qsTr("Keys for this account already exist")
|
|
importSeedError.text = qsTr("Keys for this account already exist and can't be added again. If you've lost your password, passcode or Keycard, uninstall the app, reinstall and access your keys by entering your seed phrase")
|
|
} else {
|
|
importSeedError.title = qsTr("Error importing seed")
|
|
importSeedError.text = error
|
|
}
|
|
importSeedError.open()
|
|
}
|
|
onAccountImportSuccess: {
|
|
enterSeedPhraseModal.wentNext = true
|
|
enterSeedPhraseModal.close()
|
|
recoverySuccessModal.open()
|
|
}
|
|
}
|
|
MessageDialog {
|
|
id: importSeedError
|
|
icon: StandardIcon.Critical
|
|
standardButtons: StandardButton.Ok
|
|
}
|
|
|
|
EnterSeedPhraseModal {
|
|
property bool wentNext: false
|
|
id: enterSeedPhraseModal
|
|
onConfirmSeedClick: function (mnemonic) {
|
|
OnboardingStore.importMnemonic(mnemonic)
|
|
}
|
|
onClosed: function () {
|
|
if (!wentNext) {
|
|
existingKeyView.onClosed()
|
|
}
|
|
}
|
|
}
|
|
|
|
MnemonicRecoverySuccessModal {
|
|
property bool wentNext: false
|
|
id: recoverySuccessModal
|
|
onButtonClicked: {
|
|
recoverySuccessModal.wentNext = true
|
|
recoverySuccessModal.close()
|
|
showCreatePasswordView()
|
|
}
|
|
onClosed: function () {
|
|
if (!recoverySuccessModal.wentNext) {
|
|
existingKeyView.onClosed()
|
|
}
|
|
}
|
|
}
|
|
}
|