diff --git a/public/locales/en.json b/public/locales/en.json index 84afa41..f980794 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -866,6 +866,7 @@ }, "walletLimitMessage": "You have more wallets stored than KristWeb supports. This was either caused by a bug, or you bypassed it intentionally. Expect issues with syncing.", + "contactLimitMessage": "You have more contacts stored than KristWeb supports. This was either caused by a bug, or you bypassed it intentionally. Expect issues with syncing.", "optionalFieldUnset": "(unset)", diff --git a/src/components/wallets/SyncWallets.tsx b/src/components/wallets/SyncWallets.tsx index 5a85511..90f7212 100644 --- a/src/components/wallets/SyncWallets.tsx +++ b/src/components/wallets/SyncWallets.tsx @@ -9,6 +9,7 @@ import { useTranslation } from "react-i18next"; import { syncWallets, useWallets, ADDRESS_LIST_LIMIT } from "@wallets"; +import { useContacts } from "@contacts"; import Debug from "debug"; const debug = Debug("kristweb:sync-wallets"); @@ -39,14 +40,25 @@ // the user if they have more wallets than ADDRESS_LIST_LIMIT; bypassing this // limit will generally result in issues with syncing/fetching. const { addressList } = useWallets(); + const { contactAddressList } = useContacts(); + useEffect(() => { + const warningStyle = { style: { maxWidth: 512, marginLeft: "auto", marginRight: "auto" }}; + if (addressList.length > ADDRESS_LIST_LIMIT) { message.warning({ content: t("walletLimitMessage"), - style: { maxWidth: 512, marginLeft: "auto", marginRight: "auto" } + ...warningStyle }); } - }, [t, addressList.length]); + + if (contactAddressList.length > ADDRESS_LIST_LIMIT) { + message.warning({ + content: t("contactLimitMessage"), + ...warningStyle + }); + } + }, [t, addressList.length, contactAddressList.length]); return null; }