Skip to content

Commit

Permalink
feat: guard against empty networks, chaindID, or lcd (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwmerz authored Apr 4, 2023
1 parent 3d6d359 commit c699eef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/history/HistoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ const HistoryList = ({ chainID }: Props) => {
const result: any[] = []
const txhases: string[] = []

if (!networks || !networks[chainID] || !networks[chainID].lcd) {
return result
}

const requests = await Promise.all(
EVENTS.map((event) =>
axios.get<AccountHistory>(`/cosmos/tx/v1beta1/txs`, {
EVENTS.map((event) => {
return axios.get<AccountHistory>(`/cosmos/tx/v1beta1/txs`, {
baseURL: networks[chainID].lcd,
params: {
events: `${event}='${address}'`,
Expand All @@ -46,7 +50,7 @@ const HistoryList = ({ chainID }: Props) => {
"pagination.limit": LIMIT,
},
})
)
})
)

for (const { data } of requests) {
Expand Down

0 comments on commit c699eef

Please sign in to comment.