Skip to content

Commit

Permalink
Merge branch 'main' into refactor--unused-drops-component
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored Sep 10, 2024
2 parents 7b0d692 + bfce50c commit 8f1ce5e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions composables/useIdentity.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { ComputedRef } from 'vue'
import { type Prefix } from '@kodadot1/static'
import { isEthereumAddress } from '@polkadot/util-crypto'
import { accountToPublicKey, getss58AddressByPrefix } from '@/utils/account'
import shortAddress from '@/utils/shortAddress'

export type IdentityFields = Record<string, string>

export const useIdentityQuery = (urlPrefix: Ref<Prefix>) => {
const isDotAddress = computed(() => ['dot', 'ahp'].includes(urlPrefix.value))
const { isEvm } = useIsChain(computed(() => urlPrefix.value))

const getIdentityId = (address: string) => {
if (isEvm.value) {
if (isEthereumAddress(address)) {
return address
}
else if (isDotAddress.value) {
Expand Down Expand Up @@ -94,9 +94,5 @@ const displayName = ({
return customNameOption
}

if (profileName?.length > 20) {
return shortenedAddress.value
}

return profileName || shortenedAddress.value
}

0 comments on commit 8f1ce5e

Please sign in to comment.