Skip to content

Commit

Permalink
temp remove task queue fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Feb 19, 2024
1 parent e972a66 commit 69bed44
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions trade.renegade.fi/hooks/use-tasks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { renegade } from "@/app/providers"
import { useRenegade } from "@/contexts/Renegade/renegade-context"
import { useEffect, useState } from "react"
import { useState } from "react"


export const useTasks = () => {
const [tasks, setTasks] = useState<
const [tasks, _] = useState<
{
id?: string | undefined
status?:
Expand All @@ -16,19 +14,19 @@ export const useTasks = () => {
committed?: boolean | undefined
}[]
>([])
const { accountId } = useRenegade()
// const { accountId } = useRenegade()

useEffect(() => {
if (!accountId) return
const interval = setInterval(async () => {
const _tasks = await renegade.queryTaskQueue(accountId)
setTasks(_tasks)
}, 5000)
// useEffect(() => {
// if (!accountId) return
// const interval = setInterval(async () => {
// const _tasks = await renegade.queryTaskQueue(accountId)
// setTasks(_tasks)
// }, 5000)

return () => {
clearInterval(interval)
}
}, [accountId])
// return () => {
// clearInterval(interval)
// }
// }, [accountId])

return tasks
}

0 comments on commit 69bed44

Please sign in to comment.