Skip to content

Commit

Permalink
fix: handle only most common scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Sep 25, 2023
1 parent 1ddc285 commit 4c52200
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions ui/helpers/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ import {
///: END:ONLY_INCLUDE_IN
// formatData :: ( date: <Unix Timestamp> ) -> String
import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils';
import {
decimalToHex,
hexToDecimal,
} from '../../../shared/modules/conversion.utils';
import { hexToDecimal } from '../../../shared/modules/conversion.utils';

export function formatDate(date, format = "M/d/y 'at' T") {
if (!date) {
Expand Down Expand Up @@ -651,19 +648,11 @@ export const isAbleToExportAccount = (keyringType = '') => {
export const checkTokenIdExists = (address, tokenId, obj) => {
// check if input tokenId is hexadecimal
// If it is convert to decimal and compare with existing tokens
// if it is decimal convert to hexadecimal and compare
// if it is neither leave as it is
const isHex = isStrictHexString(tokenId);
let convertedTokenId;
if (isHex) {
// Convert to decimal
convertedTokenId = hexToDecimal(tokenId);
// eslint-disable-next-line no-negated-condition
} else if (!isNaN(tokenId)) {
// Convert to hex
convertedTokenId = `0x${decimalToHex(tokenId)}`;
} else {
convertedTokenId = tokenId;
}

if (obj[address]) {
Expand Down

0 comments on commit 4c52200

Please sign in to comment.