mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 17:19:02 +00:00
chore(TokenSelectorViewAdaptor): extract "favorites" section name
This commit is contained in:
parent
10f952f67a
commit
a18056c7d1
@ -60,7 +60,7 @@ QObject {
|
|||||||
name: "sectionId"
|
name: "sectionId"
|
||||||
expression: {
|
expression: {
|
||||||
if (!model.currentBalance)
|
if (!model.currentBalance)
|
||||||
return "section_zzz"
|
return d.favoritesSectionId
|
||||||
|
|
||||||
if (root.enabledChainIds.length === 1)
|
if (root.enabledChainIds.length === 1)
|
||||||
return "section_%1".arg(root.enabledChainIds[0])
|
return "section_%1".arg(root.enabledChainIds[0])
|
||||||
@ -70,7 +70,7 @@ QObject {
|
|||||||
FastExpressionRole {
|
FastExpressionRole {
|
||||||
name: "sectionName"
|
name: "sectionName"
|
||||||
function getSectionName(sectionId, hasBalance) {
|
function getSectionName(sectionId, hasBalance) {
|
||||||
if (sectionId === "section_zzz")
|
if (sectionId === d.favoritesSectionId)
|
||||||
return qsTr("Popular assets")
|
return qsTr("Popular assets")
|
||||||
|
|
||||||
if (root.enabledChainIds.length === 1 && hasBalance)
|
if (root.enabledChainIds.length === 1 && hasBalance)
|
||||||
@ -115,7 +115,7 @@ QObject {
|
|||||||
},
|
},
|
||||||
FastExpressionSorter {
|
FastExpressionSorter {
|
||||||
expression: {
|
expression: {
|
||||||
if (modelLeft.sectionId === "section_zzz" && modelRight.sectionId === "section_zzz")
|
if (modelLeft.sectionId === d.favoritesSectionId && modelRight.sectionId === d.favoritesSectionId)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
const lhs = modelLeft.currencyBalance
|
const lhs = modelLeft.currencyBalance
|
||||||
@ -136,6 +136,12 @@ QObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// internals
|
// internals
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
|
||||||
|
readonly property string favoritesSectionId: "section_zzz"
|
||||||
|
}
|
||||||
|
|
||||||
RolesRenamingModel {
|
RolesRenamingModel {
|
||||||
id: renamedTokensBySymbolModel
|
id: renamedTokensBySymbolModel
|
||||||
sourceModel: root.plainTokensBySymbolModel
|
sourceModel: root.plainTokensBySymbolModel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user