From 5178825c9d08d829ad38e06fc41fd5b00892dfea Mon Sep 17 00:00:00 2001 From: Razvan Tomegea Date: Tue, 14 May 2024 11:31:33 +0300 Subject: [PATCH] Fixed username trim removes information after dot (#1172) * Added assets information in get account API call * 2.32.5 * Fixed username trim removes information after dot --- CHANGELOG.md | 6 +++++- package.json | 2 +- src/hooks/account/helpers/trimUsernameDomain.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a62fec59..88da9cae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -## [[v2.32.4]](https://github.com/multiversx/mx-sdk-dapp/pull/1171)] - 2024-04-25 + +## [[v2.32.5]](https://github.com/multiversx/mx-sdk-dapp/pull/1173)] - 2024-03-14 +- [Fixed username trim removes information after dot](https://github.com/multiversx/mx-sdk-dapp/pull/1172) + +## [[v2.32.4]](https://github.com/multiversx/mx-sdk-dapp/pull/1171)] - 2024-05-13 - [Fixed webview custom message method](https://github.com/multiversx/mx-sdk-dapp/pull/1170) ## [[v2.32.3]](https://github.com/multiversx/mx-sdk-dapp/pull/1169)] - 2024-04-25 diff --git a/package.json b/package.json index a4a16b3e8..65501fa37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-dapp", - "version": "2.32.4", + "version": "2.32.5", "description": "A library to hold the main logic for a dapp on the MultiversX blockchain", "author": "MultiversX", "license": "GPL-3.0-or-later", diff --git a/src/hooks/account/helpers/trimUsernameDomain.ts b/src/hooks/account/helpers/trimUsernameDomain.ts index aad795fff..129745f3b 100644 --- a/src/hooks/account/helpers/trimUsernameDomain.ts +++ b/src/hooks/account/helpers/trimUsernameDomain.ts @@ -3,8 +3,8 @@ export const trimUsernameDomain = (username?: string) => { return; } - const dotExists = username.lastIndexOf('.') > 0; - const trimmedPartBeforeLastDot = dotExists + const elrondSuffixExists = username.lastIndexOf('.elrond') > 0; + const trimmedPartBeforeLastDot = elrondSuffixExists ? username.substring(0, username.lastIndexOf('.')) : username;