From 3441c2e182c053ba0c7f22c9739a9d7f377c6063 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 24 Feb 2023 10:08:51 +0100 Subject: [PATCH] feat(keycard): remove balance from factory reset flow if user is not logged in Closes: #9633 --- .../keycard/helpers/KeyPairUnknownItem.qml | 72 +++++++++++-------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/ui/imports/shared/popups/keycard/helpers/KeyPairUnknownItem.qml b/ui/imports/shared/popups/keycard/helpers/KeyPairUnknownItem.qml index f04652319f..3829ef6a97 100644 --- a/ui/imports/shared/popups/keycard/helpers/KeyPairUnknownItem.qml +++ b/ui/imports/shared/popups/keycard/helpers/KeyPairUnknownItem.qml @@ -90,6 +90,41 @@ Rectangle { anchors.rightMargin: Style.current.padding ColumnLayout { + + Component { + id: balance + StatusBaseText { + + text: { + return LocaleUtils.currencyAmountToLocaleString({ + amount: parseFloat(model.account.balance), + symbol: SharedStore.RootStore.currencyStore.currentCurrencySymbol, + displayDecimals: 2}) + } + wrapMode: Text.WordWrap + font.pixelSize: Constants.keycard.general.fontSize2 + color: Theme.palette.baseColor1 + } + } + + Component { + id: fetchingBalance + StatusLoadingIndicator { + width: 12 + height: 12 + } + } + + Component { + id: path + StatusBaseText { + text: model.account.path + wrapMode: Text.WordWrap + font.pixelSize: Constants.keycard.general.fontSize2 + color: Theme.palette.baseColor1 + } + } + Row { spacing: 0 padding: 0 @@ -113,11 +148,9 @@ Rectangle { } } - StatusBaseText { - text: model.account.path - wrapMode: Text.WordWrap - font.pixelSize: Constants.keycard.general.fontSize2 - color: Theme.palette.baseColor1 + Loader { + active: Global.appIsReady + sourceComponent: path } } @@ -126,34 +159,11 @@ Rectangle { Layout.preferredHeight: parent.height } - Component { - id: balance - StatusBaseText { - - text: { - return LocaleUtils.currencyAmountToLocaleString({ - amount: parseFloat(model.account.balance), - symbol: SharedStore.RootStore.currencyStore.currentCurrencySymbol, - displayDecimals: 2}) - } - wrapMode: Text.WordWrap - font.pixelSize: Constants.keycard.general.fontSize2 - color: Theme.palette.baseColor1 - } - } - - Component { - id: fetchingBalance - StatusLoadingIndicator { - width: 12 - height: 12 - } - } - Loader { - id: fetchLoaderIndicator Layout.alignment: Qt.AlignVCenter - sourceComponent: model.account.balanceFetched? balance : fetchingBalance + sourceComponent: Global.appIsReady? + (model.account.balanceFetched? balance : fetchingBalance) + : path } } }