From b41cf5a45f4f5c39e1f11254c546c0f51566519e Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Thu, 29 Aug 2024 20:35:47 +0700 Subject: [PATCH 1/2] If enable wallet is broken while in iframe and using pjs, prompt user to go to chat page instead --- src/stores/my-account.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/stores/my-account.tsx b/src/stores/my-account.tsx index 492b49306..91640cf3c 100644 --- a/src/stores/my-account.tsx +++ b/src/stores/my-account.tsx @@ -26,7 +26,7 @@ import { waitNewBlock } from '@/utils/blockchain' import { currentNetwork } from '@/utils/network' import { wait } from '@/utils/promise' import { LocalStorage, LocalStorageAndForage } from '@/utils/storage' -import { isWebNotificationsEnabled } from '@/utils/window' +import { getIsInIframe, isWebNotificationsEnabled } from '@/utils/window' import { Wallet, WalletAccount, getWallets } from '@talismn/connect-wallets' import dayjs from 'dayjs' import toast from 'react-hot-toast' @@ -635,6 +635,15 @@ export async function enableWallet({ if (typeof unsub === 'function') unsub() } } catch (err) { + if (getIsInIframe() && preferredWallet.title === 'Polkadot.js') { + toast.custom((t) => ( + + )) + } console.error('Error enabling wallet', err) onError(err) } From 0e123f81563f7f8f07eb77f7379fef9d6728690d Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Fri, 30 Aug 2024 23:57:49 +0700 Subject: [PATCH 2/2] Fix issue with ens rate limit --- src/pages/api/accounts-data.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/api/accounts-data.ts b/src/pages/api/accounts-data.ts index e326089c1..0c9af8afb 100644 --- a/src/pages/api/accounts-data.ts +++ b/src/pages/api/accounts-data.ts @@ -149,7 +149,12 @@ async function fetchAccountsData(addresses: string[], method: 'POST' | 'GET') { ) } - const domains = await getEnsNames(evmAddressesHuman) + let domains: Record = {} + try { + domains = await getEnsNames(evmAddressesHuman) + } catch (err) { + console.error('Error fetching ENS names', err) + } const needToFetchIdsPromise = addresses.map(async (address, i) => { const evmAddress = evmAddressesHuman[i]