Skip to content

Commit

Permalink
chore: hardcode how many alerts to get
Browse files Browse the repository at this point in the history
  • Loading branch information
mariz-ov committed Dec 6, 2023
1 parent cb1d264 commit dbb4c51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/src/hooks/events/useAlerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { BLOCK_TIME } from '@/global/constants'
import { useQuery } from '@tanstack/react-query'
import { convertToDecimal, felt252ToString } from '@/global/utils'

const ALERTS_TO_GET = 1_000

const useAlerts = () => {
const {
setup: {
Expand All @@ -16,7 +18,8 @@ const useAlerts = () => {
return useQuery({
queryKey: ['alerts', account.address],
queryFn: async () => {
const {data} = await graphSdk.alerts()
/// TODO: paginate getting alerts. Settling for this right now
const {data} = await graphSdk.alerts({ first: ALERTS_TO_GET })
return (data.events?.edges ?? [])
.filter(edge => {
if (!edge?.node?.data) return false
Expand Down

0 comments on commit dbb4c51

Please sign in to comment.