Skip to content

Commit

Permalink
fix vault pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmagnus committed Feb 7, 2024
1 parent 8b3ce91 commit 9dd5bb1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions frontend/src/app/core/pages/contracts-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const ListPayments: React.FC<IListPayments> = ({
return 'Clawback'
}
if (effectItem.type === 'account_debited') {
return 'Payment send'
return 'Payment sent'
}
if (effectItem.type === 'account_credited') {
return 'Payment received'
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/hooks/useHorizon/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ export const HorizonProvider: React.FC<IProps> = ({ 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
Expand Down

0 comments on commit 9dd5bb1

Please sign in to comment.