From 72fa0823ba05a21bf04af4358070e70c09843ca6 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 8 Nov 2017 10:40:47 -0800 Subject: [PATCH] Logic changes --- .../qml/hifi/commerce/wallet/WalletHome.qml | 21 +++---------------- interface/src/commerce/Wallet.cpp | 6 +++++- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index 9b244d66ca..fd7ce0fdfd 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -218,30 +218,15 @@ Item { size: 24; // Style color: hifi.colors.blueAccent; - anchors.top: parent.top; - anchors.topMargin: 26; anchors.left: parent.left; + anchors.leftMargin: 12; anchors.right: parent.right; + anchors.rightMargin: 12; + anchors.verticalCenter: parent.verticalCenter; height: paintedHeight; wrapMode: Text.WordWrap; horizontalAlignment: Text.AlignHCenter; } - - // "Apply" button - HifiControlsUit.Button { - id: changePassphraseButton; - color: hifi.buttons.blue; - colorScheme: hifi.colorSchemes.dark; - anchors.top: noActivityText.bottom; - anchors.topMargin: 25; - anchors.horizontalCenter: parent.horizontalCenter; - width: 180; - height: 40; - text: "Apply Now"; - onClicked: { - Qt.openUrlExternally("https://www.highfidelity.com/"); - } - } } ListView { diff --git a/interface/src/commerce/Wallet.cpp b/interface/src/commerce/Wallet.cpp index b746b58015..fa72d02cca 100644 --- a/interface/src/commerce/Wallet.cpp +++ b/interface/src/commerce/Wallet.cpp @@ -324,12 +324,16 @@ Wallet::Wallet() { connect(ledger.data(), &Ledger::accountResult, this, [&]() { auto wallet = DependencyManager::get(); + auto ledger = DependencyManager::get(); auto walletScriptingInterface = DependencyManager::get(); uint status; - if (_mustRegenerateKeypair) { + if (_mustRegenerateKeypair || (!_passphrase->isEmpty() && _publicKeys.count() == 0)) { + qCDebug(commerce) << "Regenerating keys and resetting user_hfc_account. _mustRegenerateKeypair:" + << _mustRegenerateKeypair << "_publicKeys.count():" << _publicKeys.count(); _mustRegenerateKeypair = false; resetKeysOnly(); + ledger->reset(); generateKeyPair(); }