fix(MintToken): Some renames / code cleanups

Some renames / code cleanups
This commit is contained in:
Noelia 2023-06-13 12:29:21 +02:00 committed by Noelia
parent 9524ced598
commit 42c8758746
1 changed files with 15 additions and 17 deletions

View File

@ -112,8 +112,8 @@ SettingsPageLayout {
QtObject { QtObject {
id: temp_ id: temp_
property CollectibleObject collectible: CollectibleObject{} readonly property CollectibleObject collectible: CollectibleObject{}
property AssetObject asset: AssetObject{} readonly property AssetObject asset: AssetObject{}
} }
secondaryHeaderButton.type: StatusBaseButton.Type.Danger secondaryHeaderButton.type: StatusBaseButton.Type.Danger
@ -165,8 +165,7 @@ SettingsPageLayout {
if(root.state == d.tokenViewState) { if(root.state == d.tokenViewState) {
if(d.currentToken) { if(d.currentToken) {
if(d.isAssetType) { if(d.isAssetType) {
// Create new asset instance: // Copy current data:
temp_.asset.clearAsset()
temp_.asset.copyAsset(d.currentToken) temp_.asset.copyAsset(d.currentToken)
// Update to point to new instance // Update to point to new instance
@ -187,8 +186,7 @@ SettingsPageLayout {
}, },
StackView.Immediate) StackView.Immediate)
} else { } else {
// Create new collectible instance: // Copy current data:
temp_.collectible.clearCollectible()
temp_.collectible.copyCollectible(d.currentToken) temp_.collectible.copyCollectible(d.currentToken)
// Update to point to new instance // Update to point to new instance
@ -245,7 +243,7 @@ SettingsPageLayout {
id: newTokenView id: newTokenView
ColumnLayout { ColumnLayout {
id: _colLayout id: colLayout
property CollectibleObject collectible: CollectibleObject{} property CollectibleObject collectible: CollectibleObject{}
property AssetObject asset: AssetObject{} property AssetObject asset: AssetObject{}
@ -261,7 +259,7 @@ SettingsPageLayout {
id: optionsTab id: optionsTab
Layout.preferredWidth: root.viewWidth Layout.preferredWidth: root.viewWidth
currentIndex: _colLayout.isAssetView ? 1 : 0 currentIndex: colLayout.isAssetView ? 1 : 0
StatusSwitchTabButton { StatusSwitchTabButton {
id: collectiblesTab id: collectiblesTab
@ -286,20 +284,20 @@ SettingsPageLayout {
id: newCollectibleView id: newCollectibleView
isAssetView: false isAssetView: false
validationMode: !_colLayout.isAssetView ? _colLayout.validationMode : StatusInput.ValidationMode.OnlyWhenDirty validationMode: !colLayout.isAssetView ? colLayout.validationMode : StatusInput.ValidationMode.OnlyWhenDirty
collectible: _colLayout.collectible collectible: colLayout.collectible
referenceName: _colLayout.referenceName referenceName: colLayout.referenceName
referenceSymbol: _colLayout.referenceSymbol referenceSymbol: colLayout.referenceSymbol
} }
CustomCommunityNewTokenView { CustomCommunityNewTokenView {
id: newAssetView id: newAssetView
isAssetView: true isAssetView: true
validationMode: _colLayout.isAssetView ? _colLayout.validationMode : StatusInput.ValidationMode.OnlyWhenDirty validationMode: colLayout.isAssetView ? colLayout.validationMode : StatusInput.ValidationMode.OnlyWhenDirty
asset: _colLayout.asset asset: colLayout.asset
referenceName: _colLayout.referenceName referenceName: colLayout.referenceName
referenceSymbol: _colLayout.referenceSymbol referenceSymbol: colLayout.referenceSymbol
} }
component CustomCommunityNewTokenView: CommunityNewTokenView { component CustomCommunityNewTokenView: CommunityNewTokenView {
@ -317,7 +315,7 @@ SettingsPageLayout {
stackManager.push(d.previewTokenViewState, stackManager.push(d.previewTokenViewState,
previewTokenView, previewTokenView,
{ {
preview : true, preview: true,
isAssetView, isAssetView,
asset, asset,
collectible collectible