diff --git a/storybook/pages/EditCommunityTokenViewPage.qml b/storybook/pages/EditCommunityTokenViewPage.qml index b52a496ec9..bd81f1b180 100644 --- a/storybook/pages/EditCommunityTokenViewPage.qml +++ b/storybook/pages/EditCommunityTokenViewPage.qml @@ -35,6 +35,11 @@ SplitView { allNetworks: enabledNetworks accounts: WalletAccountsModel {} tokensModel: MintedTokensModel {} + tokensModelWallet: ListModel { + ListElement { + symbol: "MAI" + } + } onPreviewClicked: logs.logEvent("EditCommunityTokenView::previewClicked") } } diff --git a/storybook/pages/MintTokensSettingsPanelPage.qml b/storybook/pages/MintTokensSettingsPanelPage.qml index d592362d0d..568cc30749 100644 --- a/storybook/pages/MintTokensSettingsPanelPage.qml +++ b/storybook/pages/MintTokensSettingsPanelPage.qml @@ -57,7 +57,11 @@ SplitView { enabledNetworks: NetworksModel.enabledNetworks allNetworks: enabledNetworks accounts: WalletAccountsModel {} - + tokensModelWallet: ListModel { + ListElement { + symbol: "MAI" + } + } onMintCollectible: logs.logEvent("CommunityMintTokensSettingsPanel::mintCollectible") onMintAsset: logs.logEvent("CommunityMintTokensSettingsPanel::mintAssets") onDeleteToken: logs.logEvent("CommunityMintTokensSettingsPanel::deleteToken: " + tokenKey) diff --git a/ui/app/AppLayouts/Communities/panels/MintTokensSettingsPanel.qml b/ui/app/AppLayouts/Communities/panels/MintTokensSettingsPanel.qml index 2fa580bb5c..4fbef49c33 100644 --- a/ui/app/AppLayouts/Communities/panels/MintTokensSettingsPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/MintTokensSettingsPanel.qml @@ -24,6 +24,7 @@ StackView { // Models: property var tokensModel + property var tokensModelWallet property var accounts // Expected roles: address, name, color, emoji, walletType // Transaction related properties: @@ -183,6 +184,7 @@ StackView { allNetworks: root.allNetworks accounts: root.accounts tokensModel: root.tokensModel + tokensModelWallet: root.tokensModelWallet referenceName: newTokenPage.referenceName referenceSymbol: newTokenPage.referenceSymbol diff --git a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml index dcc2067519..46c5dcdfd6 100644 --- a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml @@ -295,13 +295,13 @@ StatusSectionLayout { mintPanel.isFeeLoading = true return } - mintPanel.errorText = qsTr("Unknown error") mintPanel.isFeeLoading = true } communityName: root.community.name tokensModel: root.community.communityTokens + tokensModelWallet: root.rootStore.tokensModelWallet layer1Networks: communityTokensStore.layer1Networks layer2Networks: communityTokensStore.layer2Networks testNetworks: communityTokensStore.testNetworks diff --git a/ui/app/AppLayouts/Communities/views/EditCommunityTokenView.qml b/ui/app/AppLayouts/Communities/views/EditCommunityTokenView.qml index 5b8ef6084d..2fc76104a6 100644 --- a/ui/app/AppLayouts/Communities/views/EditCommunityTokenView.qml +++ b/ui/app/AppLayouts/Communities/views/EditCommunityTokenView.qml @@ -24,6 +24,7 @@ StatusScrollView { property bool isAssetView: false property int validationMode: StatusInput.ValidationMode.OnlyWhenDirty property var tokensModel + property var tokensModelWallet property TokenObject collectible: TokenObject { @@ -197,9 +198,11 @@ StatusScrollView { return true // Otherwise, no repeated names allowed: - return !SQUtils.ModelUtils.contains(root.tokensModel, "symbol", symbolInput.text) + return (!SQUtils.ModelUtils.contains(root.tokensModel, "symbol", symbolInput.text) && + !SQUtils.ModelUtils.contains(root.tokensModelWallet, "symbol", symbolInput.text)) } - extraValidator.errorMessage: qsTr("You have used this token symbol before") + extraValidator.errorMessage: SQUtils.ModelUtils.contains(root.tokensModelWallet, "symbol", symbolInput.text) ? + qsTr("This token symbol is already in use") : qsTr("You have used this token symbol before") onTextChanged: { const cursorPos = input.edit.cursorPosition @@ -395,6 +398,9 @@ StatusScrollView { }, StatusValidator { id: extraValidatorItem + onErrorMessageChanged: { + customInput.validate(); + } } ] } diff --git a/ui/app/AppLayouts/stores/RootStore.qml b/ui/app/AppLayouts/stores/RootStore.qml index 2d698e3036..aec89673ba 100644 --- a/ui/app/AppLayouts/stores/RootStore.qml +++ b/ui/app/AppLayouts/stores/RootStore.qml @@ -54,6 +54,7 @@ QtObject { property var accounts: walletSectionSendInst.accounts // Not Refactored Yet // property var profileModelInst: profileModel + property var tokensModelWallet//TODO this is not available yet property var contactStore: profileSectionStore.contactsStore property var privacyStore: profileSectionStore.privacyStore