From 9dd5bb123acfe7b062cbb80168ea00d450d01cab Mon Sep 17 00:00:00 2001 From: Lucas Magnus Date: Wed, 7 Feb 2024 13:59:07 -0300 Subject: [PATCH] fix vault pagination --- frontend/src/app/core/pages/contracts-detail/index.tsx | 7 +++++++ .../vault-detail/components/list-payments/index.tsx | 2 +- frontend/src/hooks/useHorizon/context.tsx | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/core/pages/contracts-detail/index.tsx b/frontend/src/app/core/pages/contracts-detail/index.tsx index 74514b3b..8dc30ba1 100644 --- a/frontend/src/app/core/pages/contracts-detail/index.tsx +++ b/frontend/src/app/core/pages/contracts-detail/index.tsx @@ -56,6 +56,8 @@ export const ContractsDetail: React.FC = () => { const profile = await getProfile() setProfile(profile) + if (!profile?.vault) return + if (profile && contract) { const wallet = profile.vault?.wallet.key.publicKey const sponsor = await getSponsorPK() @@ -94,6 +96,11 @@ export const ContractsDetail: React.FC = () => { const profile = await getProfile() setProfile(profile) + if (!profile?.vault) { + setLoadingPosition(false) + return + } + if (contract) { getHistory(contract.id).then(history => setHistory(history)) } diff --git a/frontend/src/components/templates/vault-detail/components/list-payments/index.tsx b/frontend/src/components/templates/vault-detail/components/list-payments/index.tsx index e4ae5ab4..39fb3f65 100644 --- a/frontend/src/components/templates/vault-detail/components/list-payments/index.tsx +++ b/frontend/src/components/templates/vault-detail/components/list-payments/index.tsx @@ -88,7 +88,7 @@ export const ListPayments: React.FC = ({ return 'Clawback' } if (effectItem.type === 'account_debited') { - return 'Payment send' + return 'Payment sent' } if (effectItem.type === 'account_credited') { return 'Payment received' diff --git a/frontend/src/hooks/useHorizon/context.tsx b/frontend/src/hooks/useHorizon/context.tsx index 17eca89a..d143bc7a 100644 --- a/frontend/src/hooks/useHorizon/context.tsx +++ b/frontend/src/hooks/useHorizon/context.tsx @@ -171,7 +171,10 @@ export const HorizonProvider: React.FC = ({ children }) => { resultNext.data?._embedded?.records.filter( (effect: Hooks.UseHorizonTypes.IEffectItem) => effect.type === 'account_credited' || - effect.type === 'account_debited' + effect.type === 'account_debited' || + effect.type === 'trustline_removed' || + effect.type === 'trustline_created' || + effect.type === 'account_created' ).length || 0 return data