Sale Djenic 442c0cba62 chore(communities-wallet): various improvements on community related transaction flows
These changes should simplify the community related tx handlings on the client side, align it with
tx flows that we already have for other sending types and make it maintainable.
2025-01-30 15:49:49 +01:00

43 lines
1.1 KiB
QML

import QtQuick 2.15
import StatusQ.Core 0.1
import utils 1.0
/*!
\qmltype SingleFeeSubscriber
\inherits QtObject
\brief Helper object that parses fees response and provides fee text and error text for single fee response
*/
QtObject {
id: root
// Published properties
property var feesResponse
// Internal properties based on response
readonly property string feeText: {
if (!root.feesResponse) {
return ""
}
if (!!root.feesResponse.error) {
return "-"
}
if (!root.feesResponse || !Object.values(root.feesResponse.ethCurrency).length || !Object.values(root.feesResponse.fiatCurrency).length) {
return ""
}
return LocaleUtils.currencyAmountToLocaleString(root.feesResponse.ethCurrency)
+ " (" + LocaleUtils.currencyAmountToLocaleString(root.feesResponse.fiatCurrency) + ")"
}
readonly property string feeErrorText: {
if (!root.feesResponse)
return ""
return root.feesResponse.error
}
}