diff --git a/src/utils/ethereum.ts b/src/utils/ethereum.ts index 257741d..9b3da4c 100644 --- a/src/utils/ethereum.ts +++ b/src/utils/ethereum.ts @@ -15,6 +15,10 @@ export function ethereumAddressMatch(address1: string, address2: string): boolea return address1.toLowerCase() === address2.toLowerCase() } +export function hasEthereumWallet(): boolean { + return Boolean((window as any).ethereum) +} + export function getWeb3Provider(): Web3Provider { const provider = (window as any).ethereum return new Web3Provider(provider) diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 30379c1..2f8b723 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -41,12 +41,12 @@ Atom feed -
  • +
  • @@ -221,6 +221,7 @@ import { useEthereumAddressVerification } from "@/composables/ethereum-address-v import { BACKEND_URL } from "@/constants" import { useInstanceInfo } from "@/store/instance" import { useCurrentUser } from "@/store/user" +import { hasEthereumWallet } from "@/utils/ethereum" const route = useRoute() const { @@ -418,6 +419,10 @@ const feedUrl = $computed(() => { return `${BACKEND_URL}/feeds/${profile.username}` }) +function canVerifyEthereumAddress(): boolean { + return isCurrentUser() && hasEthereumWallet() +} + async function onVerifyEthereumAddress() { if (!profile || !isCurrentUser()) { return