fix error crash bug
This commit is contained in:
+3
-1
@@ -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}
|
||||
|
||||
+1
-1
@@ -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,
|
||||
)}`;
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user