From 56e4a453f78ffe29068af6037d7f766144dbb06e Mon Sep 17 00:00:00 2001 From: HappySean Date: Wed, 5 Jun 2024 17:13:16 +0800 Subject: [PATCH] fix: add more referrer --- src/utils.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 27dd153..b26e2b9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,27 +1,30 @@ -import { availableChains } from "./config/chains"; +import { availableChains } from './config/chains' export const isCyberWallet = () => - typeof document !== "undefined" && + typeof document !== 'undefined' && [ - "https://next.wallet.cyber.co/", - "https://wallet-sandbox.cyber.co/", - "https://wallet.cyber.co/", - "https://cyberwallet-sandbox-cyberconnect.vercel.app/", - ].includes(document.referrer); + 'https://next.wallet.cyber.co/', + 'https://wallet-sandbox.cyber.co/', + 'https://wallet.cyber.co/', + 'https://cyberwallet-sandbox-cyberconnect.vercel.app/', + 'https://link3.to/', + 'https://stg.link3.to/', + 'https://next.link3.to/', + ].includes(document.referrer) export function isChainUnsupported(chainId: number) { return !Object.values(availableChains) .map((chain) => chain.id) - .includes(chainId); + .includes(chainId) } export function getSignerAddress() { - const storage = localStorage.getItem("cyber-app-sdk"); + const storage = localStorage.getItem('cyber-app-sdk') if (!storage) { - return null; + return null } - const cyberAccountData = JSON.parse(storage); - return cyberAccountData.ownerAddress; + const cyberAccountData = JSON.parse(storage) + return cyberAccountData.ownerAddress }