fix error crash bug

This commit is contained in:
Blake Kaufman
2026-04-05 17:49:01 -04:00
parent 396ba56bce
commit 2f21946fc7
4 changed files with 6 additions and 5 deletions
@@ -11,13 +11,15 @@ export default function AccumulationAddressCard({ address }) {
const navigate = useNavigation();
const { t } = useTranslation();
const chainMeta = ACCUMULATION_CHAINS.find(c => c.id === address.sourceChain);
const chainLabel = chainMeta?.label ?? address.sourceChain;
const chainLabel = chainMeta?.label ?? address.sourceChain ?? '';
const label = `${address.sourceAsset}${
address.destinationAsset === 'BTC'
? t('constants.bitcoin_upper')
: t('constants.dollars_upper')
}`;
if (!chainLabel) return null;
return (
<TouchableOpacity
activeOpacity={0.7}
@@ -42,7 +42,7 @@ export default function AccumulationAddressDetail() {
const [isDeleting, setIsDeleting] = useState(false);
const [isPrinting, setIsPrinting] = useState(false);
const depositAddress = address.depositAddress;
const depositAddress = address.depositAddress ?? '';
const shortAddress = `${depositAddress.slice(0, 8)}...${depositAddress.slice(
-8,
)}`;
+1 -2
View File
@@ -5,8 +5,7 @@ export const ACCUMULATION_CHAINS = [
{ id: 'arbitrum', label: 'Arbitrum', assets: ['USDC', 'USDT'] },
{ id: 'optimism', label: 'Optimism', assets: ['USDC', 'USDT'] },
{ id: 'polygon', label: 'Polygon', assets: ['USDC'] },
{ id: 'tempo', label: 'Tempo', assets: ['USDC'] },
{ id: 'tron', label: 'Tron', assets: ['USDC', 'USDT'] },
{ id: 'tron', label: 'Tron', assets: ['USDT'] },
{ id: 'plasma', label: 'Plasma', assets: ['USDT'] },
];
export const ACCUMULATION_DESTINATIONS = ['BTC', 'USDB'];
+1 -1
View File
@@ -66,7 +66,7 @@ export function useAccumulationAddresses() {
publicKey,
);
if (!result || result.errror) return { error: 'create_failed' };
if (!result || result.error) return { error: 'create_failed' };
// result is the new address object from the server
const updated = [...addresses, result];
await persistAddresses(updated);