Skip to content

Commit

Permalink
Fix: don't show delegates if array is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Jul 31, 2023
1 parent e9d0a78 commit 2ba8a93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/settings/DelegatesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const useDelegates = () => {
const DelegatesList = () => {
const delegates = useDelegates()

if (!delegates) return null
if (!delegates?.results.length) return null

return (
<Paper sx={{ p: 4, mt: 2 }}>
Expand All @@ -30,7 +30,7 @@ const DelegatesList = () => {

<Grid item xs>
<ul style={{ padding: 0, margin: 0 }}>
{(delegates?.results || []).map((item) => (
{delegates.results.map((item) => (
<li
key={item.delegate}
style={{ listStyleType: 'none', marginBottom: '1em' }}
Expand Down

0 comments on commit 2ba8a93

Please sign in to comment.